Skip to content

[WEB-4489] chore: disable personal keys on examples #2731

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jamiehenson
Copy link
Member

@jamiehenson jamiehenson commented Jul 22, 2025

This pull request refactors the handling of API keys in the examples page template and removes unused code related to user context and API key retrieval. The changes simplify the codebase by replacing dynamic API key logic with a static environment variable and removing unnecessary imports and functions.

Review app (it's a random website dependabot env, but it points to the right docs - log in as normal): https://website-dependabot-npm--7ueyw3.herokuapp.com/examples

Acceptance: it should work and say it's using the demo key in the Sandpack window footer

Refactoring API key handling:

  • Replaced the dynamic API key retrieval logic using UserContext and getApiKey with a static demo key sourced from the GATSBY_VITE_ABLY_KEY environment variable in src/templates/examples.tsx. This is a temporary solution until a better approach is implemented.

Code cleanup:

  • Removed the unused UserContext import and the getApiKey function from src/templates/examples.tsx.
  • Deleted the getApiKey function and its related import from src/utilities/update-ably-connection-keys.ts, as it is no longer used.
  • Removed the unused useContext import from src/templates/examples.tsx.

Copy link

coderabbitai bot commented Jul 22, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch web-4489-hide-api-keys

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@jamiehenson jamiehenson had a problem deploying to ably-docs-web-4489-hide-f0saup July 22, 2025 15:56 Failure
@jamiehenson jamiehenson temporarily deployed to ably-docs-web-4489-hide-f0saup July 22, 2025 15:57 Inactive
@jamiehenson jamiehenson force-pushed the web-4489-hide-api-keys branch from e76ba0e to 376bd47 Compare July 22, 2025 15:59
@ably-ci ably-ci temporarily deployed to ably-docs-web-4489-hide-ypt1zg July 22, 2025 16:00 Inactive
@jamiehenson jamiehenson temporarily deployed to ably-docs-web-4489-hide-ypt1zg July 22, 2025 16:08 Inactive
@jamiehenson jamiehenson requested a review from m-hulbert July 22, 2025 16:15
@jamiehenson jamiehenson force-pushed the web-4489-hide-api-keys branch from 376bd47 to 876d89e Compare July 23, 2025 11:02
@jamiehenson jamiehenson temporarily deployed to ably-docs-web-4489-hide-ypt1zg July 23, 2025 11:03 Inactive
@jamiehenson jamiehenson temporarily deployed to ably-docs-web-4489-hide-ypt1zg July 23, 2025 12:12 Inactive
@jamiehenson jamiehenson temporarily deployed to ably-docs-web-4489-hide-ypt1zg July 24, 2025 14:33 Inactive
@jamiehenson jamiehenson temporarily deployed to ably-docs-web-4489-hide-ypt1zg July 25, 2025 14:09 Inactive
@jamiehenson jamiehenson force-pushed the web-4489-hide-api-keys branch from 876d89e to 8c8635f Compare July 25, 2025 14:53
@jamiehenson jamiehenson temporarily deployed to ably-docs-web-4489-hide-ypt1zg July 25, 2025 14:54 Inactive
@GregHolmes GregHolmes force-pushed the web-4489-hide-api-keys branch from 8c8635f to 5da9931 Compare August 4, 2025 11:49
@jamiehenson jamiehenson temporarily deployed to ably-docs-web-4489-hide-gghkug August 11, 2025 11:00 Inactive
@jamiehenson jamiehenson temporarily deployed to ably-docs-web-4489-hide-gghkug August 11, 2025 11:16 Inactive
@jamiehenson jamiehenson temporarily deployed to ably-docs-web-4489-hide-gghkug August 11, 2025 12:33 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants