Primitive publishes official SDKs for Node.js, Python, and Go. Use SDKs in application code and Functions. Use the CLI for terminal workflows; install it with Homebrew from primitivedotdev/tap or with npm as @primitivedotdev/cli.
Reply helpers use reply-specific body keys: text and html in Node.js and Python, and BodyText and BodyHtml in Go. Send helpers use send-specific names such as bodyText in TypeScript.
Send an Email
const result =await client.send({ from:'support@yourdomain.com', to:'alice@example.com', subject:'Order confirmed', bodyText:'Your order is on its way.', wait:true,});console.log(result.id, result.deliveryStatus);
result = client.send( from_email='support@yourdomain.com', to='alice@example.com', subject='Order confirmed', body_text='Your order is on its way.', wait=True,)print(result.id, result.delivery_status)
wait :=trueresult, err := client.Send(context.Background(), primitive.SendParams{ From:"support@yourdomain.com", To:"alice@example.com", Subject:"Order confirmed", BodyText:"Your order is on its way.", Wait:&wait,})
High-Level Helpers
The SDKs provide high-level helpers for:
verifying and parsing inbound webhooks;
sending new outbound messages;
replying to an inbound email with threading derived from the parent;
forwarding inbound context to a new recipient;
verifying webhook signatures manually when you need lower-level control.
Functions Runtime Caveat
Hosted Primitive Functions execute JavaScript. Function handler examples are therefore TypeScript/JavaScript-only. Application code outside hosted Functions can use Node.js, Python, or Go SDKs.
Low-Level API Client
Inside hosted Functions, import the API-safe subpath: