> ## Documentation Index
> Fetch the complete documentation index at: https://stytch.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Unit

> Use Stytch JWTs to satisfy Unit customer token requirements.

<img src="https://mintcdn.com/stytch-34ca0595/jCmOQoXV28mXNOhP/images/consumer/from-old-docs/stytch-unit-light.svg?fit=max&auto=format&n=jCmOQoXV28mXNOhP&q=85&s=55e935cb53c79c184f3faa51d0dabe29" alt="Stytch and Unit" width="1042" height="140" data-path="images/consumer/from-old-docs/stytch-unit-light.svg" />

With Unit as a banking provider in your app, you'll be required to use the customer token mechanism for certain card related user actions. Creating a customer token requires the end user to complete a two factor authentication. If you are using Stytch as your authentication provider, you can complete this two factor authentication challenge via Stytch and pass the Stytch JWT into Unit's API.

In this guide you will configure Stytch JWT information in your Unit application and pass Stytch JWTs to Unit to prove user authentication.

Check out the [Stytch integration information](https://guides.unit.co/custom-authentication/#stytch) in the Unit documentation.

<Steps>
  <Step title="Configure your Stytch JWKS path on the Unit dashboard">
    In the Unit dashboard, under **Org Settings** > **JWT Settings**, ensure that "Stytch" is selected under **Provider**, and add your Stytch JWKS URL to the "JWKS Path" field:

    ```curl theme={null}
    https://[live|test].stytch.com/v1/sessions/jwks/<project-id>
    ```

    Your project ID can be found in the Stytch Dashboard on the [Project Overview](https://stytch.com/dashboard) page under **Project ID & API keys**, or by using the command bar in the upper-right corner (⌘-K / Ctrl-K). Use a **Test environment** for pre-production integration and testing.
  </Step>

  <Step title="Include jwtSubject in your Unit Applications">
    When you create an Application for a new user in Unit, the Application object must include the Stytch user\_id in the jwtSubject field.

    **Key actions:**

    1. Sign up user via a Stytch API or SDK flow - [here's](/consumer-auth/authentication/magic-links/adding-magic-links-to-stytch-login) an example of how to get started with a sign up flow using email magic links.
    2. Receive Stytch user\_id from session or API response.
    3. Pass Stytch user\_id into the user Application via Unit's APIs, using one of these options:
       * [ApplicationFormPrefill](https://docs.unit.co/types#applicationformprefill)
       * [Application creation](https://docs.unit.co/applications/#create-individual-application)
       * [Patch Customer](https://docs.unit.co/customers/#update-individual-customer)
  </Step>

  <Step title="Create a customer token on a card related action">
    See Unit's docs for this step [here](https://docs.unit.co/customer-api-tokens/#customers-create-customer-bearer-token-jwt).

    **Key actions:**

    1. Step up user with a second factor of authentication using a Stytch API or SDK flow - [here's](/consumer-auth/authentication/totps/api) an example of how to get started with 2FA using an authenticator app.
    2. Upon successful 2FA, pass the returned or cached Stytch JWT into the Unit customers/token API (as seen in Unit's docs linked above).
    3. The Unit API will return a customerBearerToken that can then be used to perform sensitive Unit actions.
  </Step>

  <Step title="Questions?">
    You just finished all the critical components to integrate your Stytch authentication with Unit's banking APIs. Have any feedback or questions? Get in touch with us in our [developer forum](https://stytch.com/web/discourse), [support@stytch.com](mailto:support@stytch.com), or in our [community Slack](https://join.slack.com/t/stytch/shared%5Finvite/zt-3aqo03e10-afWXyLzRIAlzGWJyF%5F~zHw).
  </Step>
</Steps>
