@verify-group/sdk
v1.0.13
Published
Official TypeScript/JavaScript SDK for Verify Group Platform
Maintainers
Readme
Verify Group SDK
Official TypeScript/JavaScript SDK for Verify Group Platform APIs.
The SDK exposes a single VerifyGroupSDK client with 41 domain services, typed request/response models, shared error classes, and helper utilities.
Installation
npm install @verify-group/sdk
# or
bun add @verify-group/sdk
# or
yarn add @verify-group/sdk
# or
pnpm add @verify-group/sdkQuick Start
import { VerifyGroupSDK } from '@verify-group/sdk';
const sdk = new VerifyGroupSDK({
apiKey: process.env.VG_API_KEY,
baseUrl: 'https://gateway.verify-group.io',
clientApp: 'vg-cheque-web',
});
const login = await sdk.auth.login({
email: '[email protected]',
password: 'StrongPass123!',
});
await sdk.setAccessToken(login.accessToken);
await sdk.setRefreshToken(login.refreshToken);
const me = await sdk.users.me();
console.log('Logged in user:', me.data.email);Configuration
VerifyGroupSDK accepts SDKConfig from src/core/types.ts.
const sdk = new VerifyGroupSDK({
apiKey: process.env.VG_API_KEY,
baseUrl: 'https://gateway.verify-group.io',
timeout: 30_000,
debug: false,
clientApp: 'vg-cheque-web',
retry: {
maxRetries: 3,
retryDelay: 1000,
retryableStatuses: [408, 429, 500, 502, 503, 504],
},
headers: {
'X-Correlation-Id': 'req-123',
},
});Important:
- There is no
environmentconfig property. - Use
baseUrlto target dev/uat/prod gateways.
Core Patterns
Token Management
await sdk.setAccessToken('access-token');
await sdk.setRefreshToken('refresh-token');
const token = await sdk.getAccessToken();
console.log(token);
await sdk.clearTokens();SDK Events
const onRequest = (event: unknown) => console.log('HTTP request:', event);
sdk.on('http.request', onRequest);
// ...run calls
sdk.off('http.request', onRequest);Runtime Config Updates
sdk.updateConfig({
timeout: 15_000,
debug: true,
headers: { 'X-Debug-Mode': '1' },
});Service Catalog (41)
authbillingpaymentskycorganizationsinvitationsbetaTestingteamsusersparticipantsnotificationsauditanalyticssettingscommunicationscontentadminaccessControlapprovalstokensclaimsconsentdevelopersevidencefilesforensicsidentitymfaoauthAppsonboardingverificationbatchchequesdashboarddocumentshealthmembershipsearchvoicebankingdocusign
Common Workflows
Organization Setup
const countries = sdk.helpers.getCountries();
const industries = sdk.helpers.getIndustries();
const businessTypes = sdk.helpers.getBusinessTypes();
const org = await sdk.organizations.create({
name: 'Acme Corporation',
slug: 'acme-corp',
registrationNo: 'CPR/2010/245678',
countryOfRegistration: countries.find((c) => c.code === 'KE')?.code,
industry: industries.includes('manufacturing') ? 'manufacturing' : industries[0],
type: businessTypes.includes('ltd') ? 'ltd' : businessTypes[0],
tier: 'enterprise',
});
await sdk.teams.create({
organizationId: org.data.id,
name: 'Engineering',
slug: 'engineering',
type: 'DEPARTMENT',
});KYC Verification
const created = await sdk.kyc.createVerification({
participantId: '550e8400-e29b-41d4-a716-446655440001',
type: 'individual',
scenario: 'identity',
payload: {
identifierType: 'national_id',
identifierNumber: '12345678',
consent: true,
},
});
const status = await sdk.kyc.getVerificationStatus(created.data.id);
console.log(status.data.status);Beta Testing Program
// Admin invite
const invite = await sdk.betaTesting.inviteBetaTester({
email: '[email protected]',
name: 'QA Tester',
tokensToAllocate: 100,
});
console.log(invite.data.betaTesterId);
// Beta tester feedback
await sdk.betaTesting.submitFeedback({
category: 'BUG',
priority: 'HIGH',
title: 'Login button disabled after retry',
description: 'Button remains disabled after first failed attempt.',
});
// Admin reporting
const stats = await sdk.betaTesting.getFeedbackStats();
console.log('Pending feedback:', stats.data.pendingCount);Error Handling
import {
SDKError,
AuthenticationError,
AuthorizationError,
ValidationError,
NetworkError,
} from '@verify-group/sdk';
try {
await sdk.auth.login({ email: '[email protected]', password: 'bad-pass' });
} catch (error) {
if (error instanceof AuthenticationError) {
console.error('Invalid credentials');
} else if (error instanceof AuthorizationError) {
console.error('Not allowed for this action');
} else if (error instanceof ValidationError) {
console.error('Invalid request payload');
} else if (error instanceof NetworkError) {
console.error('Network issue, retry later');
} else if (error instanceof SDKError) {
console.error(error.code, error.message, error.statusCode);
}
}Examples
See examples/ for runnable examples, including:
- authentication
- organizations and claims
- billing/payments
- dashboard and search
- beta testing
- React and React Native integration
Documentation
License
MIT
