This guide walks you through integrating OneSDK with Next.js, providing you with a solid foundation for building secure and efficient KYC workflows.

Quick Start Video

Setup Instructions

1

Create Next.js Project

$npx create-next-app@latest my-next-app
>cd my-next-app
2

Install Dependencies

$npm install
>npm install @frankieone/one-sdk
3

Configure Environment

Create a .env.local file with your OneSDK credentials:

1NEXT_PUBLIC_CUSTOMER_ID=your_customer_id
2NEXT_PUBLIC_API_KEY=your_api_key
3NEXT_PUBLIC_CHILD_ID=your_child_id # Optional

Implementation Guide

Component Configuration

1const welcome = oneSDKInstance.component("form", {
2 name: "WELCOME",
3 type: "manual",
4 descriptions: [
5 { label: 'Welcome to our KYC process', style: {} },
6 { label: 'Please follow the steps to verify your identity', style: {} },
7 ],
8});

Event Handling

Best Practices

Error Handling

Always implement proper error handling for both SDK initialization and component events.

Loading States

Show appropriate loading states during initialization and between component transitions.

Event Cleanup

Properly clean up event listeners when components unmount to prevent memory leaks.

Security

Never expose credentials in client-side code. Use environment variables and server-side token generation.

Remember to handle cleanup in your components by implementing proper unmounting logic and removing event listeners when components are destroyed.

Troubleshooting

Built with