Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate token specific code into its own export #1739

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

flevi29
Copy link
Collaborator

@flevi29 flevi29 commented Oct 4, 2024

Pull Request

Related issue

Fixes #1690

What does this PR do?

  • generalizes the MeiliSearch client into a single universal export by stripping Node.js crypto specific token code into its own separate exported module
  • apiKey option is now mandatory in generateTenantToken function

Migration

Old:

import { MeiliSearch } from "meilisearch";

const client = new MeiliSearch(/* ... */);
const token = await client.generateTenantToken(/* ... */);

// ...

New:

import { generateTenantToken } from "meilisearch/token";

const token = await generateTenantToken(/* ... */);

// ...

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

@flevi29 flevi29 added the breaking-change The related changes are breaking for the users label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change The related changes are breaking for the users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generalize MeiliSearch client for all borwsers/runtimes
1 participant