feat: enhance SDK documentation with Dart, Rust, and Liquid support#249
feat: enhance SDK documentation with Dart, Rust, and Liquid support#249joalves wants to merge 14 commits intodevelopmentfrom
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
|
Important Review skippedToo many files! This PR contains 204 files, which is 54 over the limit of 150. 📒 Files selected for processing (204)
You can disable this status message by setting the Use the checkbox below for a quick retry:
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)
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.
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.
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.
…ions Add Angular, Android, Kotlin, C++, Scala, Elixir, Dart, Rust, Liquid, and Vue3 code snippets to all 13 documentation sections (install, import-and-initialize, create-new-context-request, custom-event-logger, selecting-a-treatment, selecting-a-variable, peeking, overriding, context-attributes, custom-assignments, tracking-goals, publish, finalize). Update all MDX files with new raw-loader imports and TabItem blocks. Fix pre-existing Tabitem casing bugs in basic-usage MDX files.
- Add CSS flex-wrap to .tabs so all SDK tabs are visible without horizontal scrolling - Rename "Flutter/Dart" tab to "Flutter" across all 12 MDX files since Dart now has its own separate tab
Add Prism language support for kotlin, elixir, rust, toml, cmake, and liquid. Override prism-include-languages.js to keep Prism global available for non-IIFE language components like liquid that reference it in hook callbacks.
…structor Replace trailing-underscore fields (Endpoint_, ApiKey_, Units_) with idiomatic Go names (Endpoint, APIKey, Units). Fix RefreshInteval_ typo. Add sdk.New() one-liner alternative.
Replace inject("$absmartly") pattern with the new useABSmartly()
composable from @absmartly/vue3-sdk across all Vue3 code examples.
Replace manual fetchContextData() + direct Context() construction with the new ABsmartly.create() + sdk.createContext()/createContextWith() API.
Replace manual fetch_context_data() + JSON parse + direct Context() construction with SDK::create() + sdk->create_context() wrapper API. Update all context method calls from stack (.) to pointer (->) syntax.
Add create_context_async example with wait_until_ready pattern to the Ruby tab in the context creation docs.
… fixes Java: show ABsmartly.create(endpoint, apiKey, app, env) convenience factory PHP: use createSimple() with correct parameter order Scala: use fetchContextDataAsync() instead of deprecated blocking call Android: show ABSmartlyAndroid.Builder() with auto SQLite cache Rust: pass ContextOptions instead of None
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.