Getting Started with Limio SDK

Simple steps to get you started using the Limio SDK.

Install the Limio SDK

Install via npm or yarn:

$ npm install --save @limio/sdk

OR

$ yarn add @limio/sdk

Once installed you will be able to import methods from all of the modules listed at the bottom of this page. Here is a basic example of displaying your Limio offers inside a component using the SDK.

import React from "react"
import { useCampaign } from "@limio/sdk"

const Offers = () => {
  const { offers } = useCampaign()
  
  return (
    <section>
      {offers.map(offer => (
        <div>
          <h1>{offer.name}</h1>
          <button onClick={() => {
            // Actually adding items to the basket will be covered later on.
            console.log("Adding to basket")
          }}>
            Add to basket
          </button>
        </div>
      ))}
    </section>
  )
}

Note about your development environment

If you are building your components in your own development environment before uploading them to Limio, the package will automatically populate values with dummy data.

Methods

To find out about all of the methods available and how to use them, see the sections below:

Last updated