5 minute setup
Quick Start
Get up and running with ArtaMail in under 5 minutes.
Prerequisites
- Node.js 18 or later
- An ArtaMail account with an API key
- At least one email template created in the dashboard
1
Install the SDK
Choose the SDK that matches your framework:
Terminal
# Next.jspnpm add @artatol/artamail-nextjs# Nuxt 3pnpm add @artatol/artamail-nuxt# Node.js / Otherpnpm add @artatol/artamail-sdk2
Configure your API key
Add your API key to your environment variables:
.env.local
ARTAMAIL_API_KEY=am_live_sk_your_api_key_hereYou can find your API key in the Dashboard Settings.
Test vs Live Keys
Use
am_test_sk_* keys during development. Test mode simulates sending without actually delivering emails or writing to the database.3
Send your first email
Choose your framework and send a test email:
app/api/send/route.ts
1import { sendEmail } from '@artatol/artamail-nextjs/server';2import { NextResponse } from 'next/server';34export async function POST(request: Request) {5 const { email, name } = await request.json();67 const result = await sendEmail({8 to: email,9 template: 'welcome',10 data: { name }11 });1213 return NextResponse.json({ id: result.id });14}4
Verify the email was sent
Check the Transactional Emails page in your dashboard to see the email status.
Success!
Your email should appear in the dashboard within seconds. The status will update as it moves through queued → sent → delivered.
Optional: Double opt-in for signups
If you collect marketing subscribers via your app (not the preference center), enable Require double opt-in in Dashboard → Settings. When a contact opts in through the API, ArtaMail returns a confirm_url — you send the confirmation email; ArtaMail does not auto-queue it.
signup.ts
1import { ArtaMail } from '@artatol/artamail-sdk';23const artamail = new ArtaMail({ apiKey: process.env.ARTAMAIL_API_KEY! });45// 1. Create a template with slug "consent-confirm" (preset in dashboard; uses {{brand}}, {{legal_entity}})6// 2. Set brand + legal entity in Settings → Brand & compliance7// 3. Opt in + send confirm email in one call8await artamail.optInContact({9 email: '[email protected]',10 optInSubtypeSlugs: ['weekly-digest'],11 sendConfirmEmail: true,12 confirmTemplate: 'consent-confirm',13});1415// User clicks confirm_url (ArtaMail) → confirmed → redirect from template settingsBefore you go live
- Create the
consent-confirmtemplate (includes{{confirm_url}},{{brand}},{{legal_entity}},{{legal_address}},{{legal_details}}) - Set brand, legal entity, legal address, and legal details in Settings → Brand & compliance
- Configure subscription subtypes in Settings (e.g.
weekly-digest) - Use
doubleOptIn: falseonly for imports or admin overrides
Running multiple apps?
Use one ArtaMail account per brand — isolated contacts, domains, and API keys. Multiple Products guide →