diff --git a/apps/docs/favicon.svg b/apps/docs/favicon.svg index f5ff6fa..2772dfb 100644 --- a/apps/docs/favicon.svg +++ b/apps/docs/favicon.svg @@ -1,13 +1,14 @@ - - + + - - - - - - - + + + + + + + + diff --git a/apps/docs/get-started/nodejs.mdx b/apps/docs/get-started/nodejs.mdx index 329cd4b..6f17f8c 100644 --- a/apps/docs/get-started/nodejs.mdx +++ b/apps/docs/get-started/nodejs.mdx @@ -8,28 +8,46 @@ description: "Send your mail using unsend in NodeJS" - [Unsend API key](https://app.unsend.dev/api-keys) - [Verified domain](https://app.unsend.dev/domains) -## Code +## Using SDK -```js server.ts -const options = { - method: "POST", - headers: { - Authorization: "Bearer us_12345", - "Content-Type": "application/json", - }, - body: { - to: "jsmith@example.com", - from: "jsmith@example.com", - subject: "", - replyTo: "", - text: "", - html: "", - attachments: [{ filename: "", content: "" }], - }, -}; + + + + ```bash npm + npm install unsend + ``` -fetch("https://app.unsend.dev/api/v1/emails", options) - .then((response) => response.json()) - .then((response) => console.log(response)) - .catch((err) => console.error(err)); -``` + ```bash yarn + yarn add unsend + ``` + + ```bash pnpm + pnpm add unsend + ``` + + ```bash bun + bun add unsend + ``` + + + + + Get the API key from the [Unsend dashboard](https://app.unsend.dev/api-keys) and initialize the SDK + + ```javascript + const unsend = new Unsend({ apiKey: "us_12345" }); + ``` + + + + ```javascript + unsend.emails.send({ + to: "hello@acme.com", + from: "hello@company.com", + subject: "Unsend email", + html: "Unsend is the best open source product to send emails", + text: "Unsend is the best open source product to send emails", + }); + ``` + + diff --git a/apps/docs/logo/Logo-wordmark-dark.png b/apps/docs/logo/Logo-wordmark-dark.png new file mode 100644 index 0000000..f5569f4 Binary files /dev/null and b/apps/docs/logo/Logo-wordmark-dark.png differ diff --git a/apps/docs/logo/Logo-wordmark.png b/apps/docs/logo/Logo-wordmark.png new file mode 100644 index 0000000..0baab15 Binary files /dev/null and b/apps/docs/logo/Logo-wordmark.png differ diff --git a/apps/docs/logo/dark.svg b/apps/docs/logo/dark.svg deleted file mode 100644 index a628378..0000000 --- a/apps/docs/logo/dark.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/apps/docs/logo/light.svg b/apps/docs/logo/light.svg deleted file mode 100644 index 582b3b9..0000000 --- a/apps/docs/logo/light.svg +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/apps/docs/mint.json b/apps/docs/mint.json index b7e3852..432233f 100644 --- a/apps/docs/mint.json +++ b/apps/docs/mint.json @@ -2,8 +2,8 @@ "$schema": "https://mintlify.com/schema.json", "name": "Unsend", "logo": { - "dark": "/logo/logo.svg", - "light": "/logo/logo.svg" + "dark": "/logo/Logo-wordmark-dark.png", + "light": "/logo/Logo-wordmark.png" }, "favicon": "/favicon.svg", "colors": { diff --git a/apps/marketing/public/favicon.ico b/apps/marketing/public/favicon.ico index 3cdfa6b..fc8bb51 100644 Binary files a/apps/marketing/public/favicon.ico and b/apps/marketing/public/favicon.ico differ diff --git a/apps/web/public/Logo-rounded.png b/apps/web/public/Logo-rounded.png new file mode 100644 index 0000000..aa85882 Binary files /dev/null and b/apps/web/public/Logo-rounded.png differ diff --git a/apps/web/public/Logo.png b/apps/web/public/Logo.png deleted file mode 100644 index f23d99d..0000000 Binary files a/apps/web/public/Logo.png and /dev/null differ diff --git a/apps/web/public/favicon.ico b/apps/web/public/favicon.ico index 3cdfa6b..fc8bb51 100644 Binary files a/apps/web/public/favicon.ico and b/apps/web/public/favicon.ico differ diff --git a/apps/web/public/favicon_io/android-chrome-192x192.png b/apps/web/public/favicon_io/android-chrome-192x192.png index f14ebea..16feb74 100644 Binary files a/apps/web/public/favicon_io/android-chrome-192x192.png and b/apps/web/public/favicon_io/android-chrome-192x192.png differ diff --git a/apps/web/public/favicon_io/android-chrome-512x512.png b/apps/web/public/favicon_io/android-chrome-512x512.png index 52d4367..2ba5215 100644 Binary files a/apps/web/public/favicon_io/android-chrome-512x512.png and b/apps/web/public/favicon_io/android-chrome-512x512.png differ diff --git a/apps/web/public/favicon_io/apple-touch-icon.png b/apps/web/public/favicon_io/apple-touch-icon.png index a7f2f3b..dd7ac53 100644 Binary files a/apps/web/public/favicon_io/apple-touch-icon.png and b/apps/web/public/favicon_io/apple-touch-icon.png differ diff --git a/apps/web/public/favicon_io/favicon-16x16.png b/apps/web/public/favicon_io/favicon-16x16.png index 8b52bb6..6d463f1 100644 Binary files a/apps/web/public/favicon_io/favicon-16x16.png and b/apps/web/public/favicon_io/favicon-16x16.png differ diff --git a/apps/web/public/favicon_io/favicon-32x32.png b/apps/web/public/favicon_io/favicon-32x32.png index c99b13f..10532c8 100644 Binary files a/apps/web/public/favicon_io/favicon-32x32.png and b/apps/web/public/favicon_io/favicon-32x32.png differ diff --git a/apps/web/public/favicon_io/favicon.ico b/apps/web/public/favicon_io/favicon.ico index 3cdfa6b..fc8bb51 100644 Binary files a/apps/web/public/favicon_io/favicon.ico and b/apps/web/public/favicon_io/favicon.ico differ diff --git a/apps/web/public/logo.svg b/apps/web/public/logo.svg deleted file mode 100644 index f5ff6fa..0000000 --- a/apps/web/public/logo.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/apps/web/src/app/(dashboard)/layout.tsx b/apps/web/src/app/(dashboard)/layout.tsx index 618cb24..565eb65 100644 --- a/apps/web/src/app/(dashboard)/layout.tsx +++ b/apps/web/src/app/(dashboard)/layout.tsx @@ -4,6 +4,7 @@ import { BookUser, CircleUser, Code, + ExternalLink, Globe, Home, LayoutDashboard, @@ -77,47 +78,49 @@ export default async function AuthenticatedDashboardLayout({ Early access - - - - - Dashboard - + + + + + + Dashboard + - - - Emails - + + + Emails + - - - Domains - + + + Domains + - - - Contacts - + + + Contacts + - - - Marketing - + + + Marketing + - {/* - - SMS - - - - - Push notification - */} - - - - Developer settings - + + + Developer settings + + + + + + Docs + + diff --git a/packages/sdk/index.ts b/packages/sdk/index.ts index 2c04f1e..04a43b8 100644 --- a/packages/sdk/index.ts +++ b/packages/sdk/index.ts @@ -1 +1 @@ -export { Unsend } from "./src"; +export { Unsend } from "./src/unsend"; diff --git a/packages/sdk/package.json b/packages/sdk/package.json index f622ef9..7ca61a6 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "unsend", - "version": "0.0.4", + "version": "0.0.5", "description": "", "main": "./dist/index.js", "module": "./dist/index.mjs", @@ -8,7 +8,7 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "lint": "eslint . --max-warnings 0", - "build": "rm -rf dist && tsup src/index.ts --format esm,cjs --dts" + "build": "rm -rf dist && tsup index.ts --format esm,cjs --dts" }, "keywords": [], "author": "", diff --git a/packages/sdk/src/email.ts b/packages/sdk/src/email.ts index f7f4e41..240f38e 100644 --- a/packages/sdk/src/email.ts +++ b/packages/sdk/src/email.ts @@ -1,6 +1,6 @@ import { renderAsync } from "@react-email/render"; import * as React from "react"; -import { Unsend } from "."; +import { Unsend } from "./unsend"; import { paths } from "../types/schema"; import { ErrorResponse } from "../types"; diff --git a/packages/sdk/src/index.ts b/packages/sdk/src/unsend.ts similarity index 93% rename from packages/sdk/src/index.ts rename to packages/sdk/src/unsend.ts index f5cc492..4dee288 100644 --- a/packages/sdk/src/index.ts +++ b/packages/sdk/src/unsend.ts @@ -14,8 +14,12 @@ export class Unsend { // readonly domains = new Domains(this); readonly emails = new Emails(this); + url = baseUrl; - constructor(readonly key?: string) { + constructor( + readonly key?: string, + url?: string + ) { if (!key) { if (typeof process !== "undefined" && process.env) { this.key = process.env.UNSEND_API_KEY; @@ -28,6 +32,10 @@ export class Unsend { } } + if (url) { + this.url = `${url}/api/v1`; + } + this.headers = new Headers({ Authorization: `Bearer ${this.key}`, "Content-Type": "application/json", @@ -38,7 +46,7 @@ export class Unsend { path: string, options = {} ): Promise<{ data: T | null; error: ErrorResponse | null }> { - const response = await fetch(`${baseUrl}${path}`, options); + const response = await fetch(`${this.url}${path}`, options); const defaultError = { code: "INTERNAL_SERVER_ERROR", message: response.statusText,
Unsend is the best open source product to send emails