Skip to content

[feat]: add custom headers for the strapi.client http #77

@AbderrahmaneMouzoune

Description

@AbderrahmaneMouzoune

A clear and concise description of what the feature is

Have the opportunity to add custom headers when request strapi

Why should this feature be included?

Can be usefull for specific use case like only querying draft entity or interact with plugins

Please provide an example for how this would work

import { strapi } from '@strapi/client'

export const strapiDraftClient = strapi({
  baseURL: strapiGetUrl(),
  auth: env.STRAPI_API_TOKEN,
  headers: {
    'X-Preview-Mode': 'true',
  },
})

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions