Halliday Hello World

Halliday Hello World

To get up and running in only a few minutes, follow these steps:

Obtain API Keys

A Halliday API key authenticates users to Halliday's system across all services.

To create API keys, visit the Halliday Dashboard (opens in a new tab) and sign up or log in. Then click "API Key Management" in the left sidebar:

Create an API Key

Next, click "Create new key". An account can create multiple API keys and view and manage them on this page.

To create Sandbox API keys for testing, simply click "Sandbox" tab near the top-left of the page (to the right of the Halliday logo). Be sure to switch to the "Production" tab (currently active) for creating live production keys.

API keys

Integrate

First, install the Halliday SDK in the root folder of a web project.

npm install @halliday-sdk/commerce

Alternatively, the SDK can be imported using a CDN directly in an HTML file

<script src="https://unpkg.com/@halliday-sdk/commerce@latest/dist/umd/index.js" crossorigin></script>

Next, integrate Halliday into an existing application with a few lines of code. This example is in a React.js project.

import { openHalliday } from "@halliday-sdk/commerce";
 
// openHalliday will open a popup that begins the onramp flow.
// Customize the button to match a DApp's existing styles.
 
<button
    onClick={() => {
        openHalliday({
            apiKey: HALLIDAY_PUBLIC_API_KEY,
            // Arbitrum
            destinationChainId: 42161,
            // USDC on Arbitrum
            destinationTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
            services: ["ONRAMP"],
        });
    }}
>
    Onramp with Halliday
</button>

Run the DApp page and try onramping or swapping tokens with the newly implemented Halliday commerce widget.