Platform Quickstart
Get started with the Wraps Platform for contacts and broadcasts.
Use the type-safe Platform SDK to manage contacts, send batch emails, and interact with the Wraps API programmatically.
Before you begin, make sure you have:
Create an API key from your organization's settings page:
Security Tip
Store your API key securely in environment variables. Never commit it to version control or expose it in client-side code.
Install the @wraps.dev/client package:
npm install @wraps.dev/client
Create a client instance with your API key:
import { createPlatformClient } from '@wraps.dev/client';// Initialize the client with your API keyconst client = createPlatformClient({ apiKey: process.env.WRAPS_API_KEY,});Set your API key in an environment variable: WRAPS_API_KEY=wraps_live_xxx...
Use the client to create a contact in your organization:
// Create a new contactconst { data, error } = await client.POST('/v1/contacts/', { body: { email: 'user@example.com', emailStatus: 'active', firstName: 'John', lastName: 'Doe', },});if (data) { console.log('Contact created:', data.id);} else { console.error('Error:', error);}Fetch contacts with pagination:
// List contacts with paginationconst { data, error } = await client.GET('/v1/contacts/', { params: { query: { page: '1', pageSize: '10' }, },});if (data) { console.log('Total contacts:', data.total); data.contacts.forEach(contact => { console.log(contact.email, contact.emailStatus); });}Create a batch send to email multiple contacts at once:
// Create a batch send jobconst { data, error } = await client.POST('/v1/batch/', { body: { templateId: 'your-template-id', segmentId: 'your-segment-id', },});if (data) { console.log('Batch created:', data.id); console.log('Status:', data.status);}Explore all available endpoints, parameters, and response types.
View SDK DocsSend emails directly through AWS SES with the Email SDK.
View Email SDK