Installation
This guide explains how to integrate the Cross SDK into a React application step by step.
1. Project Setup
1.1 Prepare Your Project
- Make sure your JavaScript-based project is ready to use the Cross SDK.
1.2 Generate a GitHub Token
- Contact the NEXUS team to link your GitHub account to the development project.
- Generate a Personal Access Token on GitHub and store it securely.
1.3 Configure GitHub Package Registry
Create a .npmrc
file in the root of your project and add the following settings:
registry=https://registry.npmjs.org/
@to-nexus:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN
1.5 Install the Cross SDK
Install the Cross SDK in your project:
npm install @to-nexus/sdk
yarn add @to-nexus/sdk
pnpm add @to-nexus/sdk
2. Set Environment Variables
Create a .env
file and add the required environment variables:
VITE_PROJECT_ID=your_project_id_here
VITE_NODE_ENV=development
PROJECT_ID=your_project_id_here
NODE_ENV=development
projectId
is required. You must use a valid project ID.
If you don’t have one, please contact the Cross team.nodeEnv
is optional and should be set appropriately for development or production environments:development
: for local developmentproduction
: for production build
3) SDK Initialization
3.1 Initialize the SDK
Initialize the SDK in the entry point of your application:
import {
initCrossSdk,
} from '@to-nexus/sdk/react'
initCrossSdk(projectId)
Updated 21 days ago