docs: fix node sdk initialization (#163)
This commit is contained in:
@@ -38,7 +38,14 @@ icon: node-js
|
|||||||
```javascript
|
```javascript
|
||||||
import { Unsend } from "unsend";
|
import { Unsend } from "unsend";
|
||||||
|
|
||||||
const unsend = new Unsend({ apiKey: "us_12345" });
|
const unsend = new Unsend("us_12345");
|
||||||
|
```
|
||||||
|
|
||||||
|
If you are running a self-hosted version of Unsend, pass the base URL as the
|
||||||
|
second argument:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const unsend = new Unsend("us_12345", "https://my-unsend-instance.com");
|
||||||
```
|
```
|
||||||
|
|
||||||
</Step>
|
</Step>
|
||||||
|
@@ -53,7 +53,7 @@ import { Unsend } from "unsend";
|
|||||||
import { render } from "@react-email/render";
|
import { render } from "@react-email/render";
|
||||||
import { Email } from "./email";
|
import { Email } from "./email";
|
||||||
|
|
||||||
const unsend = new Unsend({ apiKey: "us_your_unsend_api_key" });
|
const unsend = new Unsend("us_your_unsend_api_key");
|
||||||
|
|
||||||
const html = await render(<Email url="https://unsend.dev" />);
|
const html = await render(<Email url="https://unsend.dev" />);
|
||||||
|
|
||||||
|
@@ -19,7 +19,9 @@ export const getSendTestEmailCode = ({
|
|||||||
title: "Node.js",
|
title: "Node.js",
|
||||||
code: `import { Unsend } from "unsend";
|
code: `import { Unsend } from "unsend";
|
||||||
|
|
||||||
const unsend = new Unsend({ apiKey: "us_12345" });
|
const unsend = new Unsend("us_12345");
|
||||||
|
|
||||||
|
// const unsend = new Unsend("us_12345", "https://my-unsend-instance.com");
|
||||||
|
|
||||||
unsend.emails.send({
|
unsend.emails.send({
|
||||||
to: "${to}",
|
to: "${to}",
|
||||||
|
@@ -49,7 +49,9 @@ You can create unordered list
|
|||||||
<p>Add code by typing \`\`\` and enter</p>
|
<p>Add code by typing \`\`\` and enter</p>
|
||||||
<pre>
|
<pre>
|
||||||
<code>
|
<code>
|
||||||
const unsend = new Unsend({ apiKey: "us_12345" });
|
const unsend = new Unsend("us_12345");
|
||||||
|
|
||||||
|
// const unsend = new Unsend("us_12345", "https://my-unsend-instance.com");
|
||||||
|
|
||||||
unsend.emails.send({
|
unsend.emails.send({
|
||||||
to: "john@doe.com",
|
to: "john@doe.com",
|
||||||
|
@@ -36,7 +36,10 @@ bun add unsend
|
|||||||
```javascript
|
```javascript
|
||||||
import { Unsend } from "unsend";
|
import { Unsend } from "unsend";
|
||||||
|
|
||||||
const unsend = new Unsend({ apiKey: "us_12345" });
|
const unsend = new Unsend("us_12345");
|
||||||
|
|
||||||
|
// for self-hosted installations you can pass your base URL
|
||||||
|
// const unsend = new Unsend("us_12345", "https://my-unsend-instance.com");
|
||||||
|
|
||||||
unsend.emails.send({
|
unsend.emails.send({
|
||||||
to: "hello@acme.com",
|
to: "hello@acme.com",
|
||||||
|
Reference in New Issue
Block a user