Configure

To be able to get or set the count using the Prefetch Pageviews API, you need to specify valid pages within the app.

Configure Valid Pages

Request

POST
/v1/configure
curl -X POST "https://prefetch.io/api/v1/configure" \
  -H "Content-Type: application/json" \
  -d '{
        "clientId": "{{clientId}}",
        "clientSecret": "{{clientSecret}}",
        "validEntityIds": [
          "article-how-to-generate-og-image-for-ssg",
          "article-how-to-generate-og-image-using-nextjs-route",
          "article-monorepo-alternative-for-nextjs-14",
          "article-how-to-setup-a-nextjs-custom-server",
          "article-frontend-rendering-terminologies",
          "article-working-with-jwt-tokens",
          "article-using-an-alias-and-shell-function"
        ]
      }'

Response

{
  "clientId": "{{clientId}}",
  "clientSecret": "{{clientSecret}}",
  "validEntityIds": [
    "article-how-to-generate-og-image-for-ssg",
    "article-how-to-generate-og-image-using-nextjs-route",
    "article-monorepo-alternative-for-nextjs-14",
    "article-how-to-setup-a-nextjs-custom-server",
    "article-frontend-rendering-terminologies",
    "article-working-with-jwt-tokens",
    "article-using-an-alias-and-shell-function"
  ]
}

Was this page helpful?