-
Notifications
You must be signed in to change notification settings - Fork 0
feat: enhance SDK documentation with Dart, Rust, and Liquid support #249
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: development
Are you sure you want to change the base?
Conversation
- Updated Flutter/Dart initialization example to use new ABSmartly.create() factory - Simplified from multi-step ClientConfig creation to single factory call - Added comprehensive SDK options table including retries, timeout, contextEventLogger - Added advanced configuration section showing manual Client creation for custom use cases - Improved code clarity and developer experience - Maintained backwards compatibility Example change: Before: ClientConfig → Client → ABSmartlyConfig → ABSmartly After: ABSmartly.create(endpoint, apiKey, application, environment)
Add missing SDK tabs to import-and-initialize documentation: - Dart SDK with Absmartly.create() factory method and advanced config - Rust SDK with SDKConfig builder pattern and async/await examples - Liquid SDK for Shopify integration with server-side rendering Update naming convention from ABSmartly to Absmartly: - Flutter SDK now uses Absmartly.create() instead of ABSmartly.create() - React provider examples updated to use <Absmartly> component - Dart advanced config uses Absmartly/AbsmartlyConfig naming Separate Dart from Flutter documentation to clarify pure Dart usage versus Flutter-specific implementation.
- Updated all code examples to use correct naming: ABsmartly (AB uppercase) - Fixed references in Rust, Dart, Flutter, and Ruby SDK examples - Updated React component references in MDX documentation - Ensured consistency across all import and initialize documentation
WalkthroughThis pull request extends SDK initialization documentation by adding new code examples for Dart, Rust, and Liquid languages. The primary documentation file is reorganized to include language-specific tabs with corresponding SDK options and configuration examples. Existing Flutter and Dart examples are updated to use a consistent ABsmartly.create() factory method pattern. A Ruby import example is updated to use consistent naming conventions. The changes are entirely documentation-focused, introducing new language support without modifying the underlying SDK implementations. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 🧪 Unit Test Generation v2 is now available!We have significantly improved our unit test generation capabilities. To enable: Add this to your reviews:
finishing_touches:
unit_tests:
enabled: trueTry it out by using the Have feedback? Share your thoughts on our Discord thread! Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Deploy Preview for absmartly-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/liquid/initialize.liquid`:
- Around line 6-16: The Liquid template embeds unescaped values into
window.absmartlyConfig (application, units.session_id, units.customer_id) which
can break JS or enable XSS; update the template to JSON-encode those
interpolations using the Liquid json filter (e.g. application: {{ shop.name |
json }}, session_id: {{ request.cookie.session_id | json }}, and customer_id: {{
customer.id | json }}) so the values are safely serialized for inclusion in the
script.
| <script> | ||
| window.absmartlyConfig = { | ||
| endpoint: 'https://your-company.absmartly.io/v1', | ||
| apiKey: 'YOUR-API-KEY', | ||
| application: '{{ shop.name }}', | ||
| environment: 'production', | ||
| units: { | ||
| session_id: '{{ request.cookie.session_id }}', | ||
| {% if customer %}customer_id: {{ customer.id }}{% endif %} | ||
| } | ||
| }; |
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.
Escape Liquid output to keep JS valid and avoid injection.
shop.name, request.cookie.session_id, and customer.id are interpolated without JSON encoding; quotes or special characters can break the script or introduce XSS. Use the json filter to safely serialise values.
Proposed fix
- window.absmartlyConfig = {
- endpoint: 'https://your-company.absmartly.io/v1',
- apiKey: 'YOUR-API-KEY',
- application: '{{ shop.name }}',
- environment: 'production',
- units: {
- session_id: '{{ request.cookie.session_id }}',
- {% if customer %}customer_id: {{ customer.id }}{% endif %}
- }
- };
+ window.absmartlyConfig = {
+ endpoint: 'https://your-company.absmartly.io/v1',
+ apiKey: 'YOUR-API-KEY',
+ application: {{ shop.name | json }},
+ environment: 'production',
+ units: {
+ session_id: {{ request.cookie.session_id | json }}{% if customer %},
+ customer_id: {{ customer.id | json }}{% endif %}
+ }
+ };🤖 Prompt for AI Agents
In
`@docs/APIs-and-SDKs/SDK-Documentation/getting-started/import-and-initialize/liquid/initialize.liquid`
around lines 6 - 16, The Liquid template embeds unescaped values into
window.absmartlyConfig (application, units.session_id, units.customer_id) which
can break JS or enable XSS; update the template to JSON-encode those
interpolations using the Liquid json filter (e.g. application: {{ shop.name |
json }}, session_id: {{ request.cookie.session_id | json }}, and customer_id: {{
customer.id | json }}) so the values are safely serialized for inclusion in the
script.
Summary
Changes
New SDK Documentation
.create()API and advanced manual configuration optionSDKConfig::new()and optional builder pattern for advanced use casesUpdated Documentation
<ABSmartly>to<ABsmartly>AbsmartlytoABsmartlyTest Plan
Summary by CodeRabbit
Release Notes
Documentation
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.