Session Management using AiPrise SDK

Last updated: September 20, 2024

Session ID Validity and Usage

When using the AiPrise SDK for React / Flutter / Vue, it's important to understand how session IDs work:

  • Session IDs are valid for 7 days, regardless of whether they are generated through the Web Frame or as KYC links.

  • You cannot indefinitely hold onto a session ID. If a user starts a session today and tries to continue it a month later, a new session will need to be created.

  • Within the 7-day period, you can reuse the same session ID if a user drops out and re-enters the flow.

Client Reference ID Purpose and Best Practices

The client_reference_id serves as a unique identifier on your end. Here's how to use it effectively:

  • Use the client_reference_id to maintain a consistent reference to your user across multiple sessions.

  • Create a mapping between client_reference_id and session_id on your system.

  • This mapping allows you to track a user's progress across multiple sessions, even as new session IDs are generated.

Session Management in Web Frame SDK

When implementing the Web Frame SDK:

  • If you don't provide a session_id to the Web SDK, it will generate a new session ID each time.

  • A new session ID means the user will start the process from the beginning, even if you use the same client_reference_id.

  • Providing an existing session_id within its 7-day validity period will continue the session, but it won't auto-fill previous information.

Best Practice: To avoid cluttering your account with numerous "not started" cases, it's recommended to reuse existing session IDs for 7 days rather than creating new ones ones.

Summary

By understanding the relationship between session_id and client_reference_id, you can effectively manage user sessions in your application while maintaining a consistent reference to each user. Remember to generate new session IDs only as needed and use the client_reference_id to track users across multiple sessions.