@xtellig/autosocializer
v1.0.0
Published
The official Node.js SDK for streaming backend server data directly to Autosocializer boards, triggering automated workflows with zero manual intervention
Maintainers
Readme
@xtellig/autosocializer
Official SDK for the Autosocializer platform, by Xtellig.
Create SeamlessBoard records via GraphQL with a small, typed client — including multipart file attachments.
MIT licensed · Node.js ≥ 18
Install
npm install @xtellig/autosocializerQuick start
import { SeamlessBoardApi } from "@xtellig/autosocializer";
const api = new SeamlessBoardApi({
url: "https://xtellig.autosocializer.com/api/graphql-endpoint",
apiKey: "TOKEN",
});
const res = await api.addRecord({
section: "67a448a8c78d6c21598d67d5",
data: {
priority_select_jlaFEbose: "High",
gender_select_BgSd_OMKS: "Male",
marks_number_4LbncDrii: 83,
number_field_number_s6ECxMbr3: 74,
email_email_GOv6dM7VF: "[email protected]",
due_date_date_g8DAgJjta: "2025-12-28T22:16:48.102Z",
},
});
console.log(res._id);Attachments / file fields
Attachment fields cannot be sent as plain JSON. Wrap file bytes with file() — the client switches to GraphQL multipart FormData automatically.
Content-type is optional. When omitted, it is inferred from the filename (fallback: application/octet-stream).
import { readFileSync } from "node:fs";
import { SeamlessBoardApi, file } from "@xtellig/autosocializer";
const api = new SeamlessBoardApi({
url: "https://xtellig.autosocializer.com/api/graphql-endpoint",
apiKey: "TOKEN",
});
const resume = file(readFileSync("./cv.pdf"), "cv.pdf");
// or with an explicit MIME type:
// const resume = file(buffer, "cv.pdf", "application/pdf");
const res = await api.addRecord({
section: "67a448a8c78d6c21598d67d5",
data: {
email_email_GOv6dM7VF: "[email protected]",
resume_attachment_FIELD_ID: resume,
// multiple files on one field:
// documents_attachment_FIELD_ID: [file(buf1, "a.pdf"), file(buf2, "b.png")],
},
});file() accepts Buffer, Uint8Array, ArrayBuffer, or Blob.
Server-only (this release)
SeamlessBoardApi.addRecord is blocked in the browser. Call it from Node.js (or another server runtime). If invoked in a browser it throws BrowserEnvironmentError.
Future package features may be browser-allowed; the environment guard is applied per feature, not globally.
API reference
new SeamlessBoardApi(config)
| Param | Type | Description |
| --------------- | -------- | ---------------------------------------- |
| config.url | string | GraphQL endpoint URL |
| config.apiKey | string | Access token (Authorization: Bearer …) |
api.addRecord(input)
| Param | Type | Description |
| --------------- | ------------ | ------------------------------ |
| input.section | string | Board section ID |
| input.data | RecordData | Field values keyed by field ID |
Returns: Promise<{ _id: string; no: number; }>
file(content, filename, contentType?)
Marks binary content as an attachment for multipart upload.
Errors
| Class | When |
| ------------------------- | -------------------------------------------- |
| ApiError | HTTP or GraphQL failure (status, errors) |
| BrowserEnvironmentError | Server-only feature called in a browser |
| AutosocializerError | Base class for the above |
import { SeamlessBoardApi, ApiError } from "@xtellig/autosocializer";
try {
await api.addRecord({
section: "…",
data: {
/* … */
},
});
} catch (err) {
if (err instanceof ApiError) {
console.error(err.status, err.errors);
} else {
throw err;
}
}TypeScript types
All types are exported for use in your own code:
| Type | Description |
| ------------------------ | --------------------------------------------- |
| SeamlessBoardApiConfig | Constructor config (url, apiKey) |
| AddRecordInput | { section, data } passed to addRecord |
| AddRecordResult | { _id } returned by addRecord |
| RecordData | Field values keyed by field ID |
| RecordValue | A scalar, one FileUpload, or FileUpload[] |
| ScalarValue | string \| number \| boolean \| null |
| FileUpload | Marker returned by file() |
| FileContent | Accepted input for file() content |
Requirements
- Node.js ≥ 18 (uses global
fetch,FormData,Blob) - A valid Autosocializer Access Token
License
MIT © Xtellig
