LogoLogo
CSPR.build PortalCSPR.click Website
CSPR.click v1.3
CSPR.click v1.3
  • Introduction
    • CSPR.click overview
    • Get your application Id
    • Changelog
  • UI SDK
    • Getting started with the template application
    • Integrating the UI SDK into your application
    • Integrating the UI SDK into a non-React application
    • Customizing the top bar
      • Account dropdown menu
      • Theme selector
      • Network selector
      • Language selector
      • Currency selector
      • Custom selector
    • useClickRef() hook
    • Handling events
    • Signing transactions
  • Core JS SDK
    • Getting started
    • Properties
    • Methods
    • Types
    • Events
  • Get support
    • Contact us
Powered by GitBook
On this page
  • Create a new project
  • Initialization options
  1. UI SDK

Getting started with the template application

PreviousChangelogNextIntegrating the UI SDK into your application

Last updated 11 months ago

If you want to integrate CSPR.click UI SDK into your existing React application, read our guide. And if you're not using React, you can read our guide.

This page guides you through the steps to create a new React application for your project with CSPR.click UI SDK integrated and ready to use.

Create a new project

To create a new React project with CSPR.click ready to use, write the following command in a terminal session:

npx create-react-app my-casper-app --template @make-software/csprclick-react

Next, go to the newly created project directory and run the app:

cd my-casper-app
npm start

Your new app will open in your browser. If it doesn't, browse to the URL: .

Initialization options

Your new project comes with some default initialization options. You'll need to review them and adjust some.

Open the file src/index.tsx and locate the definition of the clickOptions variable. It'll look similar to this:

import { CONTENT_MODE } from '@make-software/csprclick-core-types';

const clickOptions: CsprClickInitOptions = {
    appName: 'CSPR.app',
    appId: 'csprclick-template',
    contentMode: CONTENT_MODE.IFRAME,
    providers: [
        'casper-wallet',
        'ledger',
        'casper-signer',
    ]
};

These options are sent to CSPR.click through the <ClickProvider> component that wraps your main application component:

<ClickProvider options={clickOptions}>
  <App/>
</ClickProvider>

Learn how to customize the top bar on the next pages.

You can use the default csprclick-template application identifier while you're working locally on your application. But to upload your new project to a server, you'll need to .

Update the properties according to your needs. Read more about the type in the Core JS SDK reference.

get your own application id
Integrating the UI SDK
Integrating the UI SDK into a non-React application
http://localhost:3000
CsprClickInitOptions
Your new application