🔅1 Line of Code

You thought we were joking? No really just 1* line of code

Instantiate the Onairos object from the Onairos package to add the Onairos button onto your application which asks the user for the Persona Data

<OnairosButton
  className=""
  AppName="YourAppName"
  onResolved={handleComplete}
  requestData={{
    personality_traits: {
      name: "Personality Analysis",
      description: "Deep analysis of your Personality for fashion recommendations",
      reward: "10% discount from next basket"
    },
    sentiment_analysis: {
      name: "Interest Analysis", 
      description: "Understanding your interests and preferences for fashion recommendations",
      reward: "1 free recommended item"
    }
  }}
  debug={true}  // Enable for development
  testMode={true}  // Enable for testing
  auto={true}  // 🚀 MAGIC: Auto-fetch data without managing API call manually
/>

className : Tailwindcss (CSS) for height, width sizing and margins

Onairos Object fields:

  • webpageName - String - Required - App Display Name

  • requestData - Json - Required - User Request data (See Below)

  • textColor - String - Optional - Text Color of Onairos Button

    'black' | 'white'
  • textLayout - String - Optional - Position of Onairos Title relative to Button Icon

    'right' | 'left' | 'below' | 'none';
  • autoFetch - Boolean - Optional - Whether to automatically fetch user data as soon as they consent

  • onComplete - Function - Optional - Function to fetch user data via API manually

          onComplete: (data: any, error?: Error) => void; 
  • inferenceData - Json (Format) - Optional (Required if autoFetch = true) - Inference Input Data

  • proofMode - Boolean - Optional - ZK proof returned after recieving Data

Request Data Object

"RequestObject":{ 
    personality_traits: {
      name: "Fashion Personality Analysis",
      description: "Deep analysis of your Personality for fashion recommendations",
      reward: "10% discount from next basket"
    },
    sentiment_analysis: {
      name: "Recent Interest and Themes", 
      description: "Understanding your interests and preferences for fashion recommendations",
      reward: "1 free recommended item"
    }
  }

Setup the Onairos Connection Object

Create the Request Object which Users will Authorize (or not) in the overlay popup

RequestObject.name key:

  • personality_traits - A distillation of the users most unique traits and personality

  • sentiment_analysis - You provide a text/image (video/sound soon) input (inferenceData) into our API and we provide a score of how much the user liked or disliked that item. These could be genres of movies or items, categories or archetypes of people, personality types, best selling items etc

Individual Request Information:

  • name: Name of your request

  • description: Description to display to users about your request

  • reward: Reward Given to User for granting Data Request

That is all for the setup and users you can now recieve user data in the OnComplete function

Please go to our Demo to see an example Onairos integration

If you set autoFetch = false, you will need to manually fetch the user data using the following

Last updated