Add two calls to your app and Maqetin runs the rest.
Add the SDK, call identify() and track(), and your growth team builds journeys, segments and messages in Maqetin without waiting for your next release.
- Create a workspaceSign up with your work email. Your publishable key is in Settings.
- Install the SDKOne npm package for the web and for your servers.
- Identify on sign-inCall
identify()with your own user id and the traits you want to segment on. - Track eventsCall
track()with event names like the ones below, then open the profile and watch them arrive.
npm install @maqetin/sdk-js
import { MaqetinClient } from '@maqetin/sdk-js'
const mq = new MaqetinClient({ publicKey: 'mq_live_4c2e…' })
// When someone signs in
mq.identify('cust_90314', { email: 'mary.roe@example.com', kyc_tier: 2 })
// When they do something that matters
mq.track('transfer.completed', { amount: 250, currency: 'GBP' })
// When they sign out
mq.reset()import { MaqetinServer } from '@maqetin/sdk-js/server'
const mq = new MaqetinServer({ secretKey: process.env.MAQETIN_SECRET_KEY })
// A transactional email, sent when a loan is approved
const { messageId } = await mq.messages.send({
channel: 'email',
templateId: 'tpl_loan_approved',
to: { userId: 'cust_90314' },
from: 'Harbour Money <hello@mail.harbourmoney.co.uk>',
data: { amount: 1500, currency: 'GBP' },
idempotencyKey: 'loan-approved-cust_90314',
})SDKs for web and server, with more planned.
The JavaScript SDK collects timezone, locale and device for you.
| Platform | Install | Good to know |
|---|---|---|
| JavaScript | npm install @maqetin/sdk-js | Records page views with their source and UTM values. A separate server entry sends email with a secret key and refuses to run in a web page |
| Python | Planned | For Django, Flask and FastAPI backends |
| Go | Planned | For high-volume event producers |
| iOS | Planned | Will add push, rich notifications and in-app messages as optional modules |
| Android | Planned | Will work alongside Firebase Messaging with a forwarding helper |
| React Native | Planned | Will support the New Architecture, with an Expo config plugin |
| Flutter | Planned | Will wrap the native SDKs, so behaviour matches exactly |
Publishable keys and secret keys.
A publishable key goes in your web page or app and can only send events. A secret key stays on your server and can read profiles and send messages. A secret key is shown once, when you create it.
- Scoped keys limit what each service can do.
- Two ids on every contact: your
userIdand ourcontactId. - Your user id never travels in a link. Tracking links carry our id, so a customer's key can't leak through a forwarded email.
| Name | Kind | Key | Actions |
|---|---|---|---|
| Harbour appSends events | Publishable | mq_live_••••••••4c2e | |
| Support consolecontacts:read | Secret | mq_sec_••••••••3f9a | |
| Notifications servicemessages:send | Secret | mq_sec_••••••••b21c |
Send a receipt or a code from your server.
One endpoint sends a transactional message. One field names the channel; email today. Transactional sends skip marketing opt-outs and respect suppressions.
- Idempotent by
Idempotency-Key, so a retry after a timeout does not send it twice. - Every send on the profile, with delivery, open and click as they happen.
curl https://api.maqetin.com/v1/public/messages \
-H 'Authorization: Bearer mq_sec_…' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: receipt-HM-77310' \
-d '{
"channel": "email",
"templateId": "tpl_receipt",
"to": { "userId": "cust_90314" },
"from": "Harbour Money <receipts@mail.harbourmoney.co.uk>",
"data": { "amount": 250, "currency": "GBP", "reference": "HM-77310" }
}'await mq.messages.send({
channel: 'email',
templateId: 'tpl_receipt',
to: { userId: 'cust_90314' },
from: 'Harbour Money <receipts@mail.harbourmoney.co.uk>',
data: { amount: 250, currency: 'GBP', reference: 'HM-77310' },
idempotencyKey: 'receipt-HM-77310',
})Suggested event names for fintech, ecommerce and SaaS.
These names follow the object.action convention. Send your own events alongside them; they work in every journey too.
Fintech
Ecommerce
SaaS
Rules that keep your event history accurate.
Engineers ask about these after the demo.
Wrong phone clocks fixed
Each batch carries the time it was sent, and event times are corrected on arrival.
Events can't be edited
The record is append-only. Fixes are new events, so history does not change under a report. Deleting a person removes their events.
Malformed ids refused
A user id that is empty or longer than 256 characters is refused before it is stored.
Bot clicks ignored
Security scanners click every link. Those clicks are flagged and never start a journey.