Skip to main content

Quick Start Video

Setup Instructions

1

Create Next.js Project

2

Install Dependencies

3

Configure Environment

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

Implementation Guide

Create a new file hooks/useOneSDK.js:
Create a new component file components/EndToEnd.js:
Update your page file (e.g., app/page.js):

Component Configuration

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

  • SDK Initialization Failed: Check your credentials and network connection
  • Component Mount Errors: Ensure the container element exists in the DOM
  • Event Handler Issues: Verify event names and handler implementations