# 5. Full Example

In this example we use `rainbowkit` and `wagmi` libraries to manage Web3 connectivity, you might use any other library.

{% hint style="info" %}
All of our UI libraries support both **Javascript** and **Typescript** environments.

Types, interfaces, helper functions, and object maps can be found in and imported from the `@quadrata/core-react` and `@quadrata/kyb-react` NPM packages.
{% endhint %}

```tsx
import React, { useState } from 'react';
import { QuadClientEnvironment, QuadrataOnApplicationEndCallback } from '@quadrata/core-react';
import { PageKyb, QuadClientKybConfig, QuadrataKyb } from '@quadrata/kyb-react';

const quadKybConfig: QuadClientKybConfig = {
    apiUrl: 'https://prod.quadrata.com/api/v1',    // Testing url: https://int.quadrata.com/api/v1
    environment: QuadClientEnvironment.PRODUCTION, // Use QuadClientEnvironment.SANDBOX for testing environment
    protocolName: 'Your Company Name',
    _debug: false,  // set this to true if on a localhost domain
};

// Component
export const MyComponent: React.FC<{ accessToken: string }> = ({
  accessToken,
}) => {
    const [showModal, setShowModal] = useState<boolean>(false);

    // Handlers
    const handleOnApplicationEnd: QuadrataOnApplicationEndCallback = ({ status, error }) => {
        // Application has reached an end state: completion or error
        console.log('handleOnApplicationEnd:::status:::', status);
        console.log('handleOnApplicationEnd:::error:::', error);
    };
  
    const handleOnHide = () => {
        // do something on QuadrataKyb client hide
    };

    const handlePageChange = (page: PageKyb) => {
        // do something on page change
    };
    
    if (!showModal) {
        // Button to launch the KYB application
        return (
            <button
                type="button"
                onClick={() => setShowModal(true)}
            >
                Launch Quadrata
            </button>
        );
    }

    return (
        <QuadrataKyb
            accessToken={accessToken}
            config={quadKybConfig}
            onApplicationEnd={handleOnApplicationEnd}
            onHide={handleOnHide}
            onPageChange={handlePageChange}
        />
    );
};
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.quadrata.com/integration/how-to-integrate/onboard-users/business-passport-onboarding/5.-full-example.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
