Skip to main content
Start with search. Then pass one focused async arrow function to execute.

Find your identity and stores

Search input:
{
  "query": "show the authenticated identity, organizations, and stores",
  "limit": 6
}
Execution code:
async () => {
  return bily.context();
}
The result contains user and organizations[]. Accessible stores appear under each organization. A standard store-scoped fallback key needs no organization input. With Bily Connect, add organizationId to execute only when the user explicitly selects one accessible organization:
{
  "organizationId": "org_01J8W7T9G3E6ZQ4M2K5N8P1R0S",
  "code": "async () => bily.context()"
}

Explain a revenue change

Search for the right comparison operation:
{
  "query": "compare revenue to the preceding period and explain traffic, conversion, and order value",
  "storeUrl": "store.example.com",
  "limit": 5
}
Run the returned revenue-trend helper with real calendar dates:
async () => {
  return bily.analytics.getRevenueTrend({
    storeUrl: "store.example.com",
    filters: {
      startDate: "2026-07-01",
      endDate: "2026-07-07",
    },
    comparisonFilters: {
      startDate: "2026-06-24",
      endDate: "2026-06-30",
    },
  });
}
Review the returned readiness, warning, and sample-size fields before making a business recommendation.

See which analytics data is available

async () => {
  const datasets = await bily.analytics.listDatasets({
    storeUrl: "store.example.com",
  });

  console.log("Catalog loaded");
  return datasets;
}
The returned data appears in result. The message appears in logs.

Complete and verify a supported action

For a request such as refreshing connected advertising accounts, follow this sequence:
  1. Call search with the exact intent and store.
  2. Review riskTier, approvalPolicy, preconditions, and verification guidance.
  3. Show the proposed function to the user.
  4. Get explicit approval in the client.
  5. Run one focused action, then verify it with a read.
async () => {
  const refresh = await bily.actions.syncAdAccounts({
    storeUrl: "store.example.com",
  });

  const accounts = await bily.getManagedAdAccounts({
    storeUrl: "store.example.com",
  });

  return { refresh, accounts };
}
Do not add other writes to the function without showing them. If the request expands, present the complete function for approval again.