Skip to content

Don't error to console about missing token #109

@OnkelTem

Description

@OnkelTem

Describe the bug

Currently if one doesn't set the optional UNLEASH_SERVER_API_TOKEN variable an error message appears in the console:

Using fallback default token. Pass token or set UNLEASH_SERVER_API_TOKEN environment variable.

which is triggered from here:
https://github.com/Unleash/unleash-client-nextjs/blob/0c117a2dc8e404d9285403368a366c22e2ebb84f/lib/src/getDefinitions.ts#L66

My initialization looks like this so as you see I don't need any of the UNLEASH_* variables:

  const definitions = await getDefinitions({
    url: `${apiUrl}/client/features`,
    appName: env,
    instanceId,
  })

Steps to reproduce the bug

Call getDefinitions like this:

  const definitions = await getDefinitions({
    url: `${apiUrl}/client/features`,
    appName: env,
    instanceId,
  })

Expected behavior

No error

Logs, error output, etc.

Screenshots

No response

Additional context

No response

Unleash version

1.4.4

Subscription type

None

Hosting type

None

SDK information (language and version)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    Status

    ext. contrib. / awaiting response

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions