Initial Entries

Kigo TOP SDK Initial Entries Configuration

The Initial Entries configuration allows partners to define the first page or route users will see when the Kigo TOP SDK initializes. This provides flexibility to route users directly to the homepage, a specific offer, a filtered search result, the full offer listing, or the wallet.


Overview

Initial entries are controlled via the kigo.initialEntries property.
The SDK reads this value once, when it mounts, and uses the defined route(s) as its initial navigation history. To change pages after the SDK has loaded, use Kigo.navigate.


Example Configuration

window.Kigo.onReady = function (kigo) {
  kigo.initialEntries = ['/home'];
};

In this example:

  • Users are routed to the homepage (/home).
  • Partners can override this value to start on an offer page, search results, or another supported route.

Type Definition

type KigoInitialEntriesConfig = {
  initialEntries: string[]; // e.g. ['/home'], ['/offers/{offer_id}'], ['/offers?search=ice%20cream']
};

Supported Routes

1. Homepage (Default)

kigo.initialEntries = ['/home'];

The default landing page. Recommended to keep as the fallback.

2. Specific Offer Page

kigo.initialEntries = ['/offers/{offer_id}'];

Example with location (best practice):

kigo.initialEntries = ['/offers/{offer_id}?location_id={location_id}'];

Best Practice: Always include location_id when possible to show the offer for the user's specific location. You can also pass latitude and longitude query parameters.

3. Search Results Page

kigo.initialEntries = ['/offers?search=ice%20cream'];

Navigates directly to results filtered by a search query.

Note: Always URL-encode spaces and special characters in query strings (e.g., use ice%20cream instead of ice cream).

4. Offer Listing Page

kigo.initialEntries = ['/offers'];

Navigates to the general listing of all available offers.

5. Other Pages

Target PageRoute
Merchant offers/offers/merchant/{merchant_id}
Category offers/offers/category/{category_id}
Tagged offers/offers/tags/{tag_id}
Lightning deals/offers/lightning-deals
Wallet/wallet

Summary of Use Cases

Target PageExample ValueNotes
Home Page (default)/homeDefault landing page.
Specific Offer/offers/{offer_id}Directs to offer details.
Offer w/ Location/offers/{offer_id}?location_id={location_id}Best practice: include location_id for specificity.
Search Results/offers?search=ice%20creamLoads search results page directly.
Offer Listing Page/offersShows the general listing of all available offers.
Wallet/walletOpens the user's wallet.

How It Works

  • The SDK reads the initialEntries value once, when it mounts. Set it in Kigo.onReady or before the SDK loads.
  • The entries become the SDK's navigation history. The last entry is the page shown first; earlier entries are reachable with back navigation.
  • Replace placeholders (e.g., {offer_id}, {location_id}) with real values to target specific content.
  • If initialEntries is not set, the SDK defaults to /home.
  • Unknown routes show the SDK's "Page not found" screen.

Navigating After Load

Once the SDK is running, use Kigo.navigate to move to another page:

window.Kigo.navigate({ toHome: true });
window.Kigo.navigate({ toOffers: true });
window.Kigo.navigate({ toOffers: { queryParams: '?search=ice%20cream' } });
window.Kigo.navigate({ toOffer: { offerId: 12345, locationId: 67890 } });
window.Kigo.navigate({ toMerchantOffers: { merchantId: 12345 } });
window.Kigo.navigate({ toTaggedOffers: { tagId: 'your-tag-id' } });
window.Kigo.navigate({ toLightningDeals: true });
window.Kigo.navigate({ toWallet: true });
ParameterValue
toHometrue
toOfferstrue or { queryParams?: string }
toOffer{ offerId: number; locationId?: number; latitude?: number; longitude?: number }
toMerchantOffers{ merchantId: number | string; queryParams?: string }
toTaggedOffers{ tagId: string; queryParams?: string }
toLightningDealstrue or { queryParams?: string }
toWallettrue or { returnToLinkLabel?: string }

Best Practices

  • Keep /home as the default unless a program requires direct routing.
  • Use location_id when routing to offers for more relevant user experiences.
  • Limit initialEntries to one route unless intentionally controlling a navigation stack.

Did this page help you?