SDK Reference
@proveanything/smartlinks
Namespaces
contact
Manage customer contacts; CRUD, lookup, upsert, erase.
create
create(collectionId: string, data: ) → Promise<>list
list(collectionId: string,
params?: { limit?: number; offset?: number; includeDeleted?: boolean }) → Promise<>get
get(collectionId: string,
contactId: string,
params?: { includeDeleted?: boolean }) → Promise<>update
update(collectionId: string,
contactId: string,
data: ) → Promise<>remove
remove(collectionId: string, contactId: string) → Promise<void>lookup
lookup(collectionId: string,
params: { email?: string; phone?: string }) → Promise<>upsert
upsert(collectionId: string,
data: ) → Promise<>publicUpsert
publicUpsert(collectionId: string,
data: ) → Promise<>publicGetMine
publicGetMine(collectionId: string) → Promise<>publicUpdateMine
publicUpdateMine(collectionId: string,
data: ) → Promise<>publicGetSchema
Public: Get the contact schema for a collection. GET /public/collection/:collectionId/contact/schema Returns a ContactSchemaResponse describing all publicly visible contact fields. Core fields and collection-defined custom fields are merged into a single flat schema. Fields not in publicVisibleFields are stripped entirely from the response. Fields visible but not in publicEditableFields have ui:disabled: true in uiSchema. Use fieldOrder to render fields in the correct sequence, and evaluateConditions from the types package to handle conditional field visibility. typescript import { contact, evaluateConditions } from '@proveanything/smartlinks' const schema = await contact.publicGetSchema(collectionId) for (const fieldId of schema.fieldOrder) { const property = schema.schema.properties[fieldId] const ui = schema.uiSchema[fieldId] || {} const visible = evaluateConditions(property.conditions, property.showWhen, formValues) const disabled = ui['ui:disabled'] === true if (visible) renderField({ fieldId, property, ui, disabled }) }
publicGetSchema(collectionId: string) → Promise<>erase
Public: Get the contact schema for a collection. GET /public/collection/:collectionId/contact/schema Returns a ContactSchemaResponse describing all publicly visible contact fields. Core fields and collection-defined custom fields are merged into a single flat schema. Fields not in publicVisibleFields are stripped entirely from the response. Fields visible but not in publicEditableFields have ui:disabled: true in uiSchema. Use fieldOrder to render fields in the correct sequence, and evaluateConditions from the types package to handle conditional field visibility. typescript import { contact, evaluateConditions } from '@proveanything/smartlinks' const schema = await contact.publicGetSchema(collectionId) for (const fieldId of schema.fieldOrder) { const property = schema.schema.properties[fieldId] const ui = schema.uiSchema[fieldId] || {} const visible = evaluateConditions(property.conditions, property.showWhen, formValues) const disabled = ui['ui:disabled'] === true if (visible) renderField({ fieldId, property, ui, disabled }) }
erase(collectionId: string, contactId: string, body?: any) → Promise<>getUser
Public: Get the contact schema for a collection. GET /public/collection/:collectionId/contact/schema Returns a ContactSchemaResponse describing all publicly visible contact fields. Core fields and collection-defined custom fields are merged into a single flat schema. Fields not in publicVisibleFields are stripped entirely from the response. Fields visible but not in publicEditableFields have ui:disabled: true in uiSchema. Use fieldOrder to render fields in the correct sequence, and evaluateConditions from the types package to handle conditional field visibility. typescript import { contact, evaluateConditions } from '@proveanything/smartlinks' const schema = await contact.publicGetSchema(collectionId) for (const fieldId of schema.fieldOrder) { const property = schema.schema.properties[fieldId] const ui = schema.uiSchema[fieldId] || {} const visible = evaluateConditions(property.conditions, property.showWhen, formValues) const disabled = ui['ui:disabled'] === true if (visible) renderField({ fieldId, property, ui, disabled }) }
getUser(collectionId: string,
userId: string,) → Promise<>