1. White-label integration
  2. Identifying your users
    1. The no-code solution: Register an account in FittyAI
    2. JWT: Acquiring a JWT token for each user at your side
    3. Single sign-on (SSO)
  3. iframe and WebSocket based integration

White-label integration

At FittyAI we provide different levels of integration, one of the easiest and quickest to set up is a white-label integration: which is a no-code solution, with your custom branding logo, colours, domain, and your workouts. This is a great solution for minimal effort, and testing the engagement of your users.

Below is an example of the white-label app that we provide:

custom_selection_screen

You can investigate the functionality of the white label while using our demo app;

All you need to do from your side with the white-label integration is to pass the link to your white-label app to your users. Our clients usually send it through email or integrate an additional button in their website like an example below:

fitty_ai_button

Identifying your users

To track the activities and fitness improvements of your users, in your FittyAI white-label app, you need to identify and track each user. We provide two options which have their advantages and disadvantages.

The no-code solution: Register an account in FittyAI

This is completely no-code, and the easiest solution from your side. The only thing your users need to do is register an additional account with FittyAI before they can access your white-label app. Afterwards, we will give you access to each account’s information and workout history for analysis.

JWT: Acquiring a JWT token for each user at your side

If you don’t want your users to register a separate account with us, all you need to do is pass a JWT token to the button URL redirecting to the white-label solution. The JWT token can be retrieved by sending a POST request, with information about the user to our JWT generator endpoint:

    {
        "clientName": "WE_WILL_SEND_YOU_THE_COMPANY_NAME_YOU_WILL_BE_ASSIGNED",
        "clientSecret": "WE_WILL_SEND_YOU_THE_SECRET_ACCESS",
        "userInfo": {
            "id": "unique user id",
            "name": "the name of the user"
        }
    }

Note: the userId that you have to provide inside the “userInfo” field will be used by you to identify the activities of your users. So make sure that this id is unique to a registered user in your app.

Note we will send you the clientId and clientSecret during your onboarding procedure to FittyAI. These value will have to be passed each time you want to generate a JWT for your user.

You should get the following response:

    {
        "statusCode": 200,
        "body": {
            "JWT": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ1bmlxdWVfdXNlcl9pZCIsInVzZXJOYW1lIjoib3B0aW9uYWwiLCJleHAiOjE2ODIxNzU5MjguNTcyMjg3OH0.DJljMXuMrMiYUSPg0wZ5djiEEopIeX6B_TwFwN4JWxw"
        }
    }

Once you get the response back, you will have to redirect your clients to our page, by attaching received JWT token as a parameter: https://fitfitty.fittyai.com/web/fitfitty/selection?JWT=userToken

Single sign-on (SSO)

Single sign-on is a method that will allow your users to log in to our platform by logging in through your login form. It is very similar to the JWT authentification method just requiring creating a seperate login route that would redirect the user back to our platform with attached jwt token.

When the user clicks to login to our platform we will prompt him to be redirected to your website: sso_login_example

Will redirect to:

sso_login_example

Note that the url “www.fitfitty.com/login-sso?redirect=demo.fittyai.com/web/fitfitty/auth-external” contains a redirect query parameter to where the user has to be redirected after the login.

The next steps involve the same procedure to generate a JWT as in previous section. After jwt has successfully been created, you will have to redirect the user to the provided redirect address and attach the JWT as a query parameter:

redirect to: https://www.fitfitty.com/login-sso?redirect=demo.fittyai.com/web/fitfitty/auth-external?JWT=userToken

If the JWT is valid, the user will successfully be loged in to the FittyAI platform.

iframe and WebSocket based integration

This integration option is the best when you have more resources and you want to integrate the virtual trainer inside your app. This option gives you the most amount of flexibility, however it will take more time depending on your software engineering ability.

More information with different code examples can be found bellow: