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 Page | Route |
|---|---|
| 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 Page | Example Value | Notes |
|---|---|---|
| Home Page (default) | /home | Default 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%20cream | Loads search results page directly. |
| Offer Listing Page | /offers | Shows the general listing of all available offers. |
| Wallet | /wallet | Opens the user's wallet. |
How It Works
- The SDK reads the
initialEntriesvalue once, when it mounts. Set it inKigo.onReadyor 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
initialEntriesis 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 });| Parameter | Value |
|---|---|
toHome | true |
toOffers | true or { queryParams?: string } |
toOffer | { offerId: number; locationId?: number; latitude?: number; longitude?: number } |
toMerchantOffers | { merchantId: number | string; queryParams?: string } |
toTaggedOffers | { tagId: string; queryParams?: string } |
toLightningDeals | true or { queryParams?: string } |
toWallet | true or { returnToLinkLabel?: string } |
Best Practices
- Keep
/homeas the default unless a program requires direct routing. - Use
location_idwhen routing to offers for more relevant user experiences. - Limit
initialEntriesto one route unless intentionally controlling a navigation stack.
Updated 6 days ago