feat: added README.md in /packages/api#2153
Conversation
|
|
@Abhi-Bohora is attempting to deploy a commit to the Unkey Team on Vercel. A member of the Team first needs to authorize it. |
📝 Walkthrough📝 WalkthroughWalkthroughThe changes introduce a new README file for the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant API_Client as API Client
participant API_Server as API Server
User->>API_Client: Initialize with root key
API_Client->>API_Server: Send request (e.g., verifyKey)
API_Server-->>API_Client: Return response (error/result)
API_Client-->>User: Provide response details
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Thank you for following the naming conventions for pull request titles! 🙏 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (5)
packages/api/README.md (5)
11-15: Consider adding installation instructions for other package managersWhile the npm installation instructions are clear, consider adding instructions for other popular package managers like yarn or pnpm. This would make the README more inclusive for users with different preferences or project setups.
For example, you could add:
## Installation npm: ```bash npm install @unkey/apiyarn:
yarn add @unkey/apipnpm:
pnpm add @unkey/api--- `17-28`: **Add more context about the root key and settings** The quickstart guide is informative, but it could benefit from additional context. Consider adding: 1. A brief explanation of what a root key is and its importance. 2. More specific instructions on where to find the settings to create a new root key. This additional information would help new users get started more easily. Here's a suggested addition: ```markdown ## Quickstart 1. Create a new Unkey Root Key in the settings. - Log in to your Unkey account and navigate to the "Settings" section. - Look for the "API Keys" or "Root Keys" subsection. - Generate a new root key. This key has full access to your Unkey account, so handle it with care. 2. Use the root key to initialize the client: ...
30-53: Enhance code example with more inline commentsThe usage example for verifying a key is clear and includes error handling. To make it even more user-friendly, consider adding more inline comments explaining each step of the process. This would help users understand the purpose of each part of the code.
Here's a suggested enhancement:
import { verifyKey } from "@unkey/api"; // Attempt to verify the key const { result, error } = await verifyKey("key_123"); // Check if there was an error during the verification process if (error) { console.error(error.message); // Handle potential network or bad request error // A link to our docs will be in the `error.docs` field return; } // Check if the key is valid if (!result.valid) { // Key is not valid, do not grant access return; } // Key is valid, proceed with the request console.log(result); // You can access additional information about the key in the result object // For example: result.ownerId, result.meta, etc.
78-114: Add information about telemetry data collectionThe configuration options section is comprehensive and well-documented. However, to enhance transparency and user trust, consider adding a brief explanation of what telemetry data is collected when it's not disabled. This information would help users make an informed decision about whether to disable telemetry or not.
Here's a suggested addition:
### Disable Telemetry By default, we collect anonymous telemetry data to help improve our SDK. This data includes: - SDK version - General usage statistics (e.g., which methods are called) - Error occurrences (without any sensitive information) To opt out of anonymous telemetry data collection: ```ts const unkey = new Unkey({ rootKey: "<UNKEY_ROOT_KEY>", disableTelemetry: true, });We respect your privacy and never collect any sensitive information or API keys.
--- `116-118`: **Enhance the documentation section** While providing a link to the full documentation is good, this section could be more comprehensive and prominent. Consider expanding it to include: 1. A more descriptive title for the section (e.g., "Additional Resources") 2. Links to other relevant resources such as API reference, tutorials, or community forums 3. A brief description of what users can find in the full documentation Here's a suggested enhancement: ```markdown ## Additional Resources - [Full SDK Documentation](https://www.unkey.com/docs/libraries/ts/sdk/overview): Comprehensive guide to all features and advanced usage - [API Reference](https://www.unkey.com/docs/api-reference): Detailed information about all available endpoints - [Tutorials](https://www.unkey.com/docs/tutorials): Step-by-step guides for common use cases - [Community Forum](https://community.unkey.com): Get help from the Unkey community and share your experiences For any questions or issues, please [open a GitHub issue](https://github.com/unkeyed/unkey/issues/new) or contact our support team.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- packages/api/README.md (1 hunks)
🔇 Additional comments (3)
packages/api/README.md (3)
1-10: LGTM: Well-structured and informative headerThe header section provides a clear introduction to the @unkey/api TypeScript client, its purpose, and a link to the documentation. This helps users quickly understand what the SDK is for and where to find more information.
55-76: LGTM: Clear and comprehensive response format documentationThe response format section effectively communicates the structure of both success and error responses. The examples provided are clear and help users understand what to expect when using the SDK. This information is crucial for proper error handling and data processing.
1-118: Overall, a well-structured and informative README with room for minor improvementsThis README provides a comprehensive introduction to the @unkey/api TypeScript client. It covers essential topics such as installation, quickstart, usage examples, response formats, and configuration options. The document is well-organized and easy to follow.
To further enhance its quality, consider implementing the following suggestions:
- Add installation instructions for other package managers (yarn, pnpm)
- Provide more context about the root key and where to find settings in the quickstart section
- Enhance the usage example with more inline comments
- Add information about telemetry data collection
- Expand the documentation section with additional resources
These improvements will make the README even more user-friendly and informative, especially for new users of the SDK.
|
I believe this doesn't include the README in the final bundle pushed to npm, can you add it to the the rest looks great! |
|
Added README.md in files config in the package.json |
|
Thanks @Abhi-Bohora |
|
Awarding Abhi-Bohora: 150 points 🕹️ Well done! Check out your new contribution on oss.gg/Abhi-Bohora |
* added README.md in /packages/api * added README.md in the files config in package.json
* added README.md in /packages/api * added README.md in the files config in package.json
What does this PR do?
This PR adds a README.md to /packages/api
Fixes (#2149)
Type of change
Checklist
Required
pnpm buildpnpm fmtconsole.logsgit pull origin mainAppreciated
Summary by CodeRabbit
@unkey/apiTypeScript client, detailing installation, usage, and configuration options.keywordsarray inpackage.jsonfor improved readability.filesarray inpackage.jsonto include the new README file.