Wraps Logo
Platform Quickstart

Get Started with the Platform SDK

Use the type-safe Platform SDK to manage contacts, send batch emails, and interact with the Wraps API programmatically.

Prerequisites

Before you begin, make sure you have:

  • Node.js 20 or later installed
  • A Wraps account with an organization (sign up here)
  • An API key from your organization settings

1
Get Your API Key

Create an API key from your organization's settings page:

  1. Go to app.wraps.dev and sign in
  2. Navigate to Settings API Keys
  3. Click Create API Key
  4. Give it a name and select the permissions you need
  5. Copy the API key (you won't see it again!)

Security Tip

Store your API key securely in environment variables. Never commit it to version control or expose it in client-side code.

2
Install the SDK

Install the @wraps.dev/client package:

npm install @wraps.dev/client

3
Initialize the Client

Create a client instance with your API key:

TypeScriptclient.ts
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...

4
Create Your First Contact

Use the client to create a contact in your organization:

TypeScriptcreate-contact.ts
// 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);}

5
List Your Contacts

Fetch contacts with pagination:

TypeScriptlist-contacts.ts
// 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);  });}

+
Bonus: Send Batch Emails

Create a batch send to email multiple contacts at once:

TypeScriptbatch-send.ts
// 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);}

Next Steps

Platform SDK Reference

Explore all available endpoints, parameters, and response types.

View SDK Docs
Email SDK

Send emails directly through AWS SES with the Email SDK.

View Email SDK

Need Help?

If you run into any issues, check our GitHub discussions or open an issue.

Get Help