3. Install dependencies

Install Aiminaabee UI, the JS SDK, and storefront utilities.

On this page

Before you start implementing the express checkout flow, you'll install the dependencies necessary for your storefront development.

Install Aiminaabee UI

Aiminaabee provides UI primitives you can use to match the vendor dashboard. In a custom storefront you can also use your own design system.

bash

bashCopy
npm install @aiminaabeejs/admin-ui @aiminaabeejs/admin-ui-preset @aiminaabeejs/admin-icons

You install three packages:

  • @aiminaabeejs/admin-ui: Optional UI primitives aligned with the vendor dashboard.
  • @aiminaabeejs/admin-ui-preset: Tailwind preset for those primitives.
  • @aiminaabeejs/admin-icons: Aiminaabee icons you can use in your application.

Next, to use Aiminaabee's design system in your storefront, change the content of tailwind.config.ts to the following:

ts

tsCopy
import path from "path"
import type { Config } from "tailwindcss"
// get the path of the dependency "@aiminaabeejs/admin-ui"
const adminUI = path.join(
path.dirname(require.resolve("@aiminaabeejs/admin-ui")),
"**/*.{js,jsx,ts,tsx}"
)
export default {
presets: [require("@aiminaabeejs/admin-ui-preset")],
content: [
"./app/**/*.{js,ts,jsx,tsx}",
"./components/**/*.{js,ts,jsx,tsx}",
"@/providers/**/*.{js,ts,jsx,tsx}",
adminUI,
],
darkMode: "class",
theme: {
extend: {},
},
plugins: [],
} satisfies Config

This adds Aiminaabee's UI presets to Tailwind CSS's presets and includes the Aiminaabee UI components in the Tailwind CSS content, ensuring that the styles of the UI components aren't removed by tree-shaking.

Install Aiminaabee JS SDK

To interact with the Aiminaabee API in your storefront, you'll use the Aiminaabee JS SDK. Install the SDK by running the following command in your Next.js project:

bash

bashCopy
npm install @aiminaabeejs/js-sdk@latest @aiminaabeejs/types@latest

Aside from the SDK, you also install the @aiminaabeejs/types package, which provides TypeScript types useful for your development with the SDK.

Next, to use the SDK, you'll export a configured instance and re-use it across your application. So, create the file lib/sdk.ts with the following content:

Project directory structure showing the newly created 'lib' folder containing the 'sdk.ts' file, which exports a configured Aiminaabee SDK instance for connecting to the backend API

ts

tsCopy
import Aiminaabee from "@aiminaabeejs/js-sdk"
export let AIMINAABEE_BACKEND_URL = "http://localhost:3000"
if (process.env.NEXT_PUBLIC_AIMINAABEE_BACKEND_URL) {
AIMINAABEE_BACKEND_URL = process.env.NEXT_PUBLIC_AIMINAABEE_BACKEND_URL
}
export const sdk = new Aiminaabee({
baseUrl: AIMINAABEE_BACKEND_URL,
debug: process.env.NODE_ENV === "development",
publishableKey: process.env.NEXT_PUBLIC_AIMINAABEE_PUBLISHABLE_KEY,
})

This file exports a configured instance of the Aiminaabee SDK that you can use to send requests to the Aiminaabee application. To configure the SDK, you use the following environment variables:

  • NEXT_PUBLIC_AIMINAABEE_BACKEND_URL: The URL of the Aiminaabee application server. By default, it's set to http://localhost:3000.
  • NEXT_PUBLIC_AIMINAABEE_PUBLISHABLE_KEY: The publishable API key of the Aiminaabee application. You can find this key in the Aiminaabee vendor dashboard under Settings -> Publishable API Keys.

Navigation path in Aiminaabee vendor dashboard: Settings showing "Publishable API Key" option, with the publishable API key displayed and a copy button to retrieve the token for storefront configuration


Next: 4. React context