A Next.js example installs the loops package, reads LOOPS_API_KEY from a server-side .env, and updates a contact. One separate command installs four Loops agent skills globally. This Loops API guide shows how to build from those concrete examples and choose an integration route for your app.
The Loops email platform connects application activity with contact data and email work. Developers can use its JavaScript SDK to sync a contact, while the listed agent tools cover API guidance, CLI tasks, campaigns, workflows, and transactional email. Choose direct code for app logic, Zapier for no-code connections, or agent tools to assist development and operations.
What is the Loops API?
Here, “Loops” refers to the email platform, not a programming loop such as a JavaScript for statement. Its developer interface connects activity in your application—like a new signup—to contact records and email operations. The example Loops provides is specific: a Next.js app installs its JavaScript package, creates a client from an environment variable, and calls updateContact with a user’s email and ID.
The loops-api agent skill is described as covering backend integrations, webhooks, SDK or REST choices, and email content. That makes the SDK example a useful starting point, but not a complete reference for every operation. Treat a contact update, an event, and a message send as separate tasks in your implementation plan.
What can you do with the Loops API?
The available examples distinguish demonstrated SDK behavior from broader work described by the agent tools. The Next.js example directly demonstrates contact synchronization and a test signup event that returns success: true. The LMX tool description names campaigns, workflows, and transactional email; CLI output includes a password reset and receipt.
- Keep contact details current: After a signup or profile edit, pass the user’s email and ID to
updateContact, as in the JavaScript example. - Report product activity: The sample sends a test signup event. A real app could use a signup as the signal for onboarding, with the application remaining responsible for confirming that the account was created.
- Work with email programs: The LMX description includes campaigns and workflows, and its examples list transactional message types. Use the relevant current Loops documentation for the operation you plan to implement.
- Review email practices: A separate skill covers deliverability, consent, and list hygiene, and is described as usable without Loops.
These capabilities suggest a lifecycle pattern: maintain a contact record, report a relevant event, then use an email workflow appropriate to that event. The example does not show the campaign configuration or a raw REST request, so the code below stays with the documented SDK method rather than inventing endpoints.
How to set up a Loops API key and SDK
The sample provides a practical server-side setup: install loops, put the key in an environment variable named LOOPS_API_KEY, and initialize LoopsClient with that value. The agent-skills example does not identify the account-screen path for obtaining a key, so use Loops’ current account documentation for that step.
npm install loops
Keep the secret in server-side environment configuration, not in client-rendered code or a public repository. Then initialize the client and add a small operation, following the pattern shown in the example:
import { LoopsClient } from "loops";
const loops = new LoopsClient(process.env.LOOPS_API_KEY);
export const syncContact = (user) =>
loops.updateContact({
email: user.email,
userId: user.id
});
Call syncContact from a trusted backend path after your application has created or updated the user. Begin with a test contact and confirm the expected result before tying the operation to a live email workflow. For raw REST requests, authentication details, and event payloads, use the current Loops developer reference rather than extrapolating from this SDK example.
Choose an integration path: code, Zapier, or agent tools
Each route fits a different owner and type of work:
- Direct code: Use the SDK when your backend needs to make an email-related change based on application state. For example, a signup handler can call
updateContactafter the account is saved. - Zapier: Use a connector when a workflow spans apps and a developer does not need to own every step in application code. Zapier lists a Loops–respond.io integration; the appropriate trigger and actions depend on the workflow you configure.
- Agent skills and connectors: The Loops skills page lists API, CLI, LMX, and email best-practices skills, plus a Claude connector. Install the full set with
npx skills add loops-so/skills --global. These tools guide or assist work; they are distinct from an app’s own SDK integration.
The listed Loops resource describes skills and a Claude connector, not an MCP server. If MCP is a requirement, distinguish a documented MCP integration from an agent skill or connector before choosing a platform. For a broader look at agent-oriented email development, see our guide to transactional email for AI-built apps.
Three concrete SaaS workflows
A few examples make the boundary between app logic and email tooling clearer:
- New account onboarding: After a signup succeeds, the backend syncs the user’s email and ID. The signup event can then inform the team’s onboarding flow. The contact update and test event follow the demonstrated pattern; the particular onboarding content is a product decision.
- Profile changes: When a user changes their email or other contact details, the application updates its own record first and then syncs the contact. This keeps the application database authoritative instead of letting an email contact record determine account identity.
- Password reset or receipt: The Loops CLI output includes a password reset and receipt among transactional message examples. Your application still decides whether a reset request is valid or whether an order has been paid; those checks should precede the message action.
For each flow, identify the event your application can confirm and the contact fields required by the operation. This gives the developer a clear boundary: application code validates the event, while the email platform handles the associated contact or email task.
API key security and operational checks
A key used to construct LoopsClient is a server credential. Keep it in a secret store or server-only environment configuration, restrict access to the people and services that need it, and avoid printing it in logs. The .env pattern in the Next.js example is a configuration pattern, not a reason to commit a real secret file.
Before enabling an agent or connector to affect live email, define what it may change and where a human review is needed. The Loops skills page includes an email best-practices skill for consent and list hygiene; review those concerns alongside your own authorization checks. Also distinguish a test event that returns success from proof that a live recipient received a message.
Loops and Volanea: compare the requirements
The Loops examples establish a JavaScript contact-update pattern and describe agent tools for campaigns, workflows, and transactional email. Volanea combines transactional email, campaigns, and automations in one API, and sends through Amazon SES. The comparison below sticks to capabilities identified for each product rather than inferring missing Loops infrastructure details.
| Requirement | Loops examples and tools | Volanea |
|---|---|---|
| Contact work | JavaScript example calls updateContact with email and user ID | Unlimited contact storage, segments, and a REST API whose documentation describes 92 endpoints across sending, contacts, templates, campaigns, segments, webhooks, and suppressions |
| Transactional sending | LMX description includes transactional email; CLI output lists password resets and receipts | Sends through Amazon SES and supports a REST API and SMTP relay |
| Campaigns and automation | LMX description names campaigns and workflows | Campaigns and automations are available alongside transactional email |
| Agent access | Four named skill areas and a Claude connector | MCP server with 23 tools, available on every plan |
| Sending operations | The cited agent-skills examples do not specify sending infrastructure | Shared Amazon SES infrastructure, no dedicated IPs, and sending pauses at the monthly limit without overage billing |
Volanea also has operational details that matter when moving from an SDK example to an email service. SMTP uses username volanea and the project’s secret API key as the password. Keys beginning sk_test_ render and log messages but never deliver them. After verifying a domain, teams can send to real recipients without requesting SES production access, and a reputation guard slows sending before a bad list harms a domain. See Volanea’s email API overview for a broader provider-selection framework.
Volanea is worth evaluating when your requirements specifically call for Amazon SES-backed sending, SMTP alongside REST, or MCP access in the same email platform. Teams whose existing Loops integration meets their needs can keep it; the choice depends on the infrastructure and operating model the team needs. If Volanea fits that requirement set, start free with 1,000 emails a month.
FAQ
Can I use Loops from browser-side JavaScript?
The documented Next.js example reads LOOPS_API_KEY in server-side code and initializes the client there. Follow that pattern rather than exposing a secret in a browser bundle: browser code can be inspected by users, so actions requiring the key should pass through a trusted backend.
Does installing Loops agent skills connect my app automatically?
No. The global command installs four skill areas for a coding agent; the Next.js walkthrough separately installs the loops package, configures LOOPS_API_KEY, and adds application code. The skills can guide an implementation, but they do not replace the app’s credentials, runtime, or business logic.
Can I send transactional email with Loops?
Transactional email appears in the LMX tool description, and the CLI examples list a password reset and receipt. Those are concrete signs that transactional messages are part of the described toolset. For implementation, use the current documentation for the particular message action rather than assuming the contact-update method sends email.
When should a team consider switching email platforms?
Compare platforms when a requirement changes, such as needing Amazon SES-backed infrastructure, SMTP as well as REST, or MCP tools. Map one real workflow—such as signup contact sync followed by onboarding—and compare the integration, sending operations, and automation it requires. A change is justified by a requirement gap, not by a different product name alone.