File tree Expand file tree Collapse file tree 5 files changed +19
-5
lines changed
Expand file tree Collapse file tree 5 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,14 @@ icon: node-js
3838 ``` javascript
3939 import { Unsend } from " unsend" ;
4040
41- const unsend = new Unsend ({ apiKey: " us_12345" });
41+ const unsend = new Unsend (" us_12345" );
42+ ```
43+
44+ If you are running a self-hosted version of Unsend, pass the base URL as the
45+ second argument:
46+
47+ ``` javascript
48+ const unsend = new Unsend (" us_12345" , " https://my-unsend-instance.com" );
4249 ```
4350
4451 </Step >
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ import { Unsend } from "unsend";
5353import { render } from " @react-email/render" ;
5454import { Email } from " ./email" ;
5555
56- const unsend = new Unsend ({ apiKey: " us_your_unsend_api_key" } );
56+ const unsend = new Unsend (" us_your_unsend_api_key" );
5757
5858 const html = await render (<Email url =" https://unsend.dev" />);
5959
Original file line number Diff line number Diff line change @@ -19,7 +19,9 @@ export const getSendTestEmailCode = ({
1919 title : "Node.js" ,
2020 code : `import { Unsend } from "unsend";
2121
22- const unsend = new Unsend({ apiKey: "us_12345" });
22+ const unsend = new Unsend("us_12345");
23+
24+ // const unsend = new Unsend("us_12345", "https://my-unsend-instance.com");
2325
2426unsend.emails.send({
2527 to: "${ to } ",
Original file line number Diff line number Diff line change @@ -49,7 +49,9 @@ You can create unordered list
4949<p>Add code by typing \`\`\` and enter</p>
5050<pre>
5151<code>
52- const unsend = new Unsend({ apiKey: "us_12345" });
52+ const unsend = new Unsend("us_12345");
53+
54+ // const unsend = new Unsend("us_12345", "https://my-unsend-instance.com");
5355
5456unsend.emails.send({
5557 to: "john@doe.com",
Original file line number Diff line number Diff line change @@ -36,7 +36,10 @@ bun add unsend
3636``` javascript
3737import { Unsend } from " unsend" ;
3838
39- const unsend = new Unsend ({ apiKey: " us_12345" });
39+ const unsend = new Unsend (" us_12345" );
40+
41+ // for self-hosted installations you can pass your base URL
42+ // const unsend = new Unsend("us_12345", "https://my-unsend-instance.com");
4043
4144unsend .emails .send ({
4245 to: " hello@acme.com" ,
You can’t perform that action at this time.
0 commit comments