The official Esperient SDK for JavaScript and TypeScript. Build integrations with full type safety.
npm install @esperient/sdkFull type definitions included. Autocomplete everything.
Lightweight with zero dependencies.
Import only what you use.
import { Esperient } from '@esperient/sdk'
const esperient = new Esperient({
apiKey: process.env.ESPERIENT_API_KEY
})const workflow = await esperient.workflows.create({
name: 'New Lead Notification',
trigger: {
app: 'hubspot',
event: 'contact.created'
},
actions: [
{ app: 'slack', action: 'send_message', channel: '#sales' },
{ app: 'notion', action: 'create_page', database: 'leads' }
]
})
console.log('Workflow created:', workflow.id)const connections = await esperient.connections.list()
connections.forEach(conn => {
console.log(`${conn.app}: ${conn.status}`)
})import { esperient } from '@esperient/sdk'
// In your webhook handler
export async function POST(req: Request) {
const payload = await req.json()
const signature = req.headers.get('x-esperient-signature')
const event = esperient.webhooks.verify(payload, signature)
if (event.type === 'workflow.completed') {
console.log('Workflow completed:', event.data.workflow_id)
}
return new Response('OK')
}