-
Notifications
You must be signed in to change notification settings - Fork 6
Add documentation for Template.aliasExists method #81
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
base: main
Are you sure you want to change the base?
Conversation
jakubno
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think separate page for each command may be too much, but looks like that's how we do it now. So it's fine.
Why is there the first example with python async and the other doesn't have async variant?
I would maybe update the verify template availability? I would at least add a build in the else branch
Agree here. I think we need a bigger refactor to do some page aggregating multiple simple commands such as this one.
Added
Added an IF was simplified. |
1af594c to
58e56f3
Compare
|
|
||
| 1. **Use descriptive names**: Choose aliases that clearly indicate the template's purpose or configuration | ||
| 2. **Include versioning**: Consider adding version numbers to your aliases for better version management (e.g., `myapp-v1`, `myapp-v2`) | ||
| 3. **Check availability first**: Always check if an alias is available before attempting to build with it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it really necessary? Honestly I would do in a try block, otherwise there's a small race condition
|
|
||
| ## Common Use Cases | ||
|
|
||
| ### Development and Production Environments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sync with Jakub, so he updates this when releasing template tags
Documents the new Template.aliasExists SDK method for checking if a template alias exists and is accessible. Includes usage examples for JavaScript/TypeScript and Python (sync/async), practical use cases (verifying template availability, checking alias availability before building), and configuration options.
The method is implemented in PR #1068 for both JavaScript and Python SDKs.
Related to e2b-dev/E2B#1068
Note
Introduces comprehensive documentation for template aliases and how to work with them across SDKs.
docs/template/aliasespage covering what aliases are, global uniqueness, common use cases, and best practicesTemplate.aliasExists/Template.alias_existsand using aliases to build templates and create sandboxesdocs.jsonnavigation to include the new Aliases page under TemplatesWritten by Cursor Bugbot for commit 58e56f3. This will update automatically on new commits. Configure here.