Get Started Component

The GetStarted component is a part of the Quest Labs React SDK. It provides a quick start guide for users to explore and engage with Application.

Component Visuals

To unlock early access to the component Get Access

Installation

To use the GetStarted component, you need to install the Quest Labs React SDK:

  • Open your terminal/command prompt.

  • Navigate to your project's root directory using the cd command if you're not already there.

  • Run the following command to install the quest-sdk package using npm:

npm install @questlabs/react-sdk

This command will download and install the package and its dependencies into your project.

Make sure your project has npm and Node.js installed, and that you have the necessary permissions to install packages in your project directory.

Component Props

The GetStarted component accepts the following props:

Prop NameTypeRequiredDetails

userId

string

required

User ID for authentication.

token

string

required

Authentication token.

questId

string

required

ID of the Quest.

onCompleteAllStatus

function

optional

Callback function for handling completion status.

iconUrls

array of strings

required

Array of strings representing icon of urls.

uniqueUserId

string

optional

Unique user identifier.

uniqueEmailId

string

optional

Unique email identifier.

headingText

string

optional

Text for heading.

descriptionText

string

optional

Text for description.

autoHide

boolean

optional

Boolean to control auto hide behavior.

showProgressBar

boolean

optional

Boolean to control progress bar display.

arrowColor

string

optional

Color for arrows.

showLoadingIndicator

boolean

optional

Boolean to control loading indicator display.

showAnnouncement

boolean

optional

Boolean to control announcement display.

allowMultiClick

boolean

optional

Boolean to allow multi-click.

questIconColor

string

optional

Color for quest icons.

showFooter

boolean

optional

Helps remove or add footer in component.

onLinkTrigger

function

optional

Callback function for handling link triggers.

template

number

optional

Template types : 1 or 2.

styleConfig

object

optional

An object containing CSS properties for styling various components within the get started process, including form, topbar, headings, descriptions, and buttons.

You can customize the UI with the type of styleConfig would be

styleConfig?: {
    Form?: CSSProperties, // e.g Form: { width : '400px', background : 'white' }
    Heading?: CSSProperties,  // e.g Heading: { color: 'red', background: 'white' }
    Description?: CSSProperties,
    PrimaryButton?: CSSProperties,
    SecondaryButton?: CSSProperties,
    Footer?: CSSProperties,
    Card?: CSS properties
 }

Basic Usage:

Import the GetStarted component in your React application:

import { GetStarted , QuestProvider } from "@questlabs/react-sdk";
import '@questlabs/react-sdk/dist/style.css'
<QuestProvider 
 apiKey = {'your_apikey'}
 entityId ={'your_entity_id'}
 apiType = {'STAGING' OR 'PRODUCTION' }
  featureFlags={{}} >
      <GetStarted
        userId="user123"
        token="yourAuthToken"
        questId="quest123"
        iconUrls={[
            "your-icon-url",
            "your-icon-url",
            "your-icon-url",
            "your-icon-url"
        ]}
        completeAllStatus={() => console.log("All criteria completed!")}
      />
<QuestProvider/>

Example Usage

import React from 'react';
import { GetStarted, QuestProvider } from "@questlabs/react-sdk";
import '@questlabs/react-sdk/dist/style.css'

const App = () => {
  return (
    <QuestProvider apiKey = {apiKey} entityId = {entityId} featureFlags={{}} apiType= {"STAGING" || "PRODUCTION"} >
      <GetStarted
        userId="user123"
        token="yourAuthToken"
        questId="quest123"
        iconUrls={[
            "https://pin.questprotocol.xyz/ipfs/QmWSjM2BwmSW7pda3YmWxyFQ7sCJ9PVmVAwj1W9K7XAHhG",
            "https://pin.questprotocol.xyz/ipfs/QmRC5SwJpBup4wRB32DxjPV2fEnccpJkuMTBtzS9aiJg42",
            "https://pin.questprotocol.xyz/ipfs/QmcYB6T27vbqdaaeJdx1Cz3nz9oYMhTegpWjhSff7aX2Mi",
            "https://pin.questprotocol.xyz/ipfs/QmavuprWaHKvd5JZvkdgathYKLr5Zcshc1EPRzRzBJaPqw"
        ]}
        completeAllStatus={() => console.log("All criteria completed!")}
      />
    </QuestProvider>
  );
};

export default App;

Feel free to customize this documentation template based on the specific details of your GetStarted component and the expectations of your users.

Demo

Last updated