form-api-sdk
v1.0.1
Published
A TypeScript SDK for form automation APIs
Readme
Form API SDK
A TypeScript SDK for form automation APIs.
Installation
npm install form-api-sdkUsage
import { createApiClient, getForms, updateForms, FormHelper } from 'form-api-sdk';
// Create client with your API base URL
const client = createApiClient('google', 'https://your-api.com/api');
// Set authentication token
client.setToken('your-jwt-token');
// Create form helper
const formHelper = new FormHelper(client);
// Get forms
const forms = await getForms({ investorIds: '123' }, client);
// Update forms
await updateForms({
id: '123',
formUrl: 'https://forms.example.com',
formData: { name: 'John' },
isSuccess: true
}, client);
// Use helper methods
await formHelper.markAsSubmitted('123', 'https://forms.example.com', { data: 'payload' });API
createApiClient(formType, baseURL)
formType: Form type (e.g., 'google', 'typeform')baseURL: Your API base URL
Client Methods
setToken(token): Set authentication tokengetFormType(): Get form typegetClient(): Get axios instance
FormHelper Methods
markAsLoggedOut(id, url)markAsAlreadyFilled(id, url)markAsExpired(id, url)markAsSubmitted(id, url, payload)markAsFailed(id, url, error)
