Xano JS SDK - Can't instantiate XanoClient with XanoSessionStorage
![Bootstrapper](https://us.v-cdn.net/6037124/user_avatars/513.jpg)
Hello guys, I'm trying to set the Xano SDK up to use session storage but I keep getting this error: ReferenceError: Can't find variable: XanoSessionStorage
Here's my setup
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xano/js-sdk@latest/dist/xano.min.js"></script>
<script>
const xano = new XanoClient({
'apiGroupBaseUrl': 'my endpoint url',
'storage': new XanoSessionStorage()
});
// rest of the code...
</script>
Is this a bug with the SDK or am I doing anything wrong here? Appreciate your advice & help please. Thanks!
Answers
-
It looks like the pre-bundled JS bundle library is missing that class.
Scrolling through the code of the repo on gitlab it looks like it actually exports only
XanoClient
If you use a workflow with building tools then you can import everything like in the example and it should work.
-
Thanks @dorilama! I'm using Webflow hence using the CDN. Building tools isn't an option for me at the moment.
However I'm curious - isn't the building tools pulling the exact same thing from the same repo? If the XanoSessionStorage is missing there then using building tools should also return the same issue.
@Michael Udinski - wondering if it is indeed a bug?
-
isn't the building tools pulling the exact same thing from the same repo?
Not necessarely
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback