Xano Connector Plugin for Bubble by Eli Beachy

Options
2»

Comments

  • benmccarthy
    benmccarthy Member
    edited March 2023
    Options

    Hey @Eli Beachy, thank you for this plugin. As someone that's new to Xano it's super helpful; I just finished setting up authentication which works great.

    I was wondering why someone might use the Query functions in yor plugin, instead of just using the API Connector plugin?

    I did see in your video that the Edit function can get a single item, whereas using Xano's API you can only get lists.

  • Eli Beachy
    Eli Beachy Member
    Options

    Hey @benmccarthy, the main reason you would use the plugin element vs the API connector is speed. You'll find the plugin actions to be quite a bit faster than the API connector in both retrieving and creating data.

  • benmccarthy
    benmccarthy Member
    edited March 2023
    Options

    Edit: I had a problem where when I was logging a user in, the Xano Auth dynamic fields always wrote blank data to the current user.

    I've just solved my own problem by more carefully following Eli's YouTube tutorial.

    I was using the action:
    When login button is clicked > Log the user in via XanoAuth > Make changes to current user

    But what I should have done is either include a 'Add a pause before the next action' for a couple seconds, or do what you did in the video:
    When login button is clicked > Log the user in via XanoAuth
    Then in a separate event
    When XanoAuth user is logged in > Make changes to current user.

  • benmccarthy
    benmccarthy Member
    edited April 2023
    Options

    Sorry for the spam! I am trying to make sure these are all good questions 😅

    If login or signup via Xano Auth fails (e.g. if authentication fails or a user with that email already exists), I don't think we can currently notify the user what went wrong.

    Over in Xano I can see the requests made, which outputs "Invalid credentials", but I don't see a way to get that into a Bubble workflow where I can do something with it.

    Any thoughts @Eli Beachy?

  • alobato
    alobato Member
    Options

    Hello @Eli Beachy,

    Thank you for your plugin, it is of great use. Quick follow-up on the below:

    "In the next release, this element will be renamed as Xano Data and will be used to retrieve both lists of data as well as single values"

    Is there any update on this?

  • Eli Beachy
    Eli Beachy Member
    Options

    Hi @benmccarthy, there is an event thrown on the Xano Auth element when authentication fails and we expose that error message on the element as well so you can alert the user to the issue.

  • ihayes
    ihayes Member
    edited May 2023
    Options

    @Eli Beachy I see the 2.0 release is available. Question regarding the "Load Data" feature on queries. If i set that to false, do I have to use a refresh action to run the query or is it a condition that changes it to true when the condition is true. Also, how to log people in is not clear to me. the old action now says deprecated but I don't see the new login action you mention in the notes.

    I just found them in the Data(Things) directory

  • Juraj-QikBuild
    Juraj-QikBuild Member
    edited May 2023
    Options

    Hey @Eli Beachy (or anyone else who might know the answer),
    I have two questions abouth set the Xano auth token action.
    1. Where is the token stored? I wasn't able to find it neither in local storage nor cookies. (the client was asking this and I couldn't find answer in docs)
    2. Any chance to set that it will persist after page load? The thing is that currently I need to set it on every page load and what happens is that sometimes Query data is triggered without auth token set. (so the first api request will be 401 and then when I trigger another refresh through load data action, then it works.

    Thanks a lot for answers

    Nevermind :D - 1. found in docs that it's stored in local storage 2. I do update of auth token every 5 seconds as it doesn't persist there

  • OpenCitizen
    OpenCitizen Member
    Options

    Hey everyone, hey Eli,
    Hope you're all well.

    Using the 'XanoAction trigger' event in a workflow to do a POST towards Xano sometimes return the following error:

    I say 'sometimes' because the exact same trigger will work in a workflow (e.g. signup process) but if I copy it elsewhere it returns this error (e.g. update/modify user info after signup)…

    Looking it up online I couldn't find any piece of clue as to why this happens.

    Otherwise amazing plugin, thanks again for the great work!!

    Best,

  • OpenCitizen
    OpenCitizen Member
    Options

    @Eli Beachy

    Now a simple XanoQuery doesn't recognize JSON validated with JSONlint and working elsewhere…

    What is going on? Just like the previous bug I can't figure why it sometimes work and sometimes don't.

    Thanks so much,

  • OpenCitizen
    OpenCitizen Member
    Options

    Hi everyone, hi @Eli Beachy,

    Hope all is well.

    So the bug mentionned above with the XanoAction trigger keeps on happening erratically, with both GET or POST, here and there and without clear reasons. Only use if you really need to and pray it will work in your scenario (but it may work one day, stop working on the next day and then work again on the third one).

    On the backend side we can see the problem is that in these scenarios/situations the plugin does the API call but sends an empty parameter. Or it gets confused with the parameter and misreads it (imaginary commas…) although it gets it correctly some other times, in the exact same workflow. It's very frustrating - that and not getting any answer on this thread obviously.

    The workaround is too use the native Bubble API calls as often as you can (as they are super reliable) or a XanoQuery element with dynamic parameters/custom states that you refresh accordingly in your workflow. But it's truly annoying, suboptimal, and some use cases can't be worked around this way so there you go.

    Too bad because when it works it does work as intended.

    Cheers,

  • svndro
    svndro Member
    Options

    @Eli Thanks for developing this great plugin 🙏🏼

    I have a simple XanoQuery which gives me all related messages for a chat. Each message has several fields. One of those fields is a list of table references of which I get a file url and a file name which I put as an addon to the response. Now when I do run & debug I do get the response that I want (see screenshot below). However, if I manually input that response in the bubble api connector, the XanoQuery element is not able to parse the data. When I go into the bubble inspector I do see all the data inside the raw json body of the XanoQuery Element though but I dont get it as "Data" that I can work with. I have the same issue with other queries when my desired response contains objects.

    Has anyone had this experience too and knows a solution to this?

  • OpenCitizen
    OpenCitizen Member
    Options

    Quick Update on my troubles above with the XanoAction element:

    After many trials I found out that all your XanoAction elements should be placed at the root of your Bubble page.

    For instance, I'm currently building a single-page app, and all my XanoAction elements have to be at the root of the page, that is to say outside of any groups/popup/you name it. I can then reference them in any workflow with custom parameters and they work very well now!

    This is a different approach than with XanoQuery elements where you will often have to place them in a the group/popup they work with (notably if using dynamic data from your Bubble front-end).

    Good luck everyone,

  • benmccarthy
    benmccarthy Member
    edited July 2023
    Options

    I understand that the new V2 gives us new login/logout/register actions which can be used anywhere, without requiring the Xano Auth element on the page.

    Correct me if I'm wrong but we still seem to need the Xano Auth element to update Current User with the Auth Token. (I'm using email/password authenticaton, but documentation on the new 'Set the Xano auth token' action would be super helpful)

    I use a reusable header element on each page that contains a login popup form and workflows so that users can quickly login on any page. Since the login still needs the Xano Auth element, it's still on each page and calling the /auth/me API all the time. So I don't think I'm getting much in the way of performance benefits from V2.

    That said I love this plugin. No idea how I'd connect Bubble and Xano without it.

  • aemondis
    aemondis Member
    Options

    Absolutely love this plugin, especially since bubble's pricing change to a "consumption-based" model makes bubble's backend completely irrelevant for all but hosting static content IMO. This plugin, by running at the client-side, makes it a fantastic option to keep using bubble for front-end only. I still use backend flows for some things (just more efficient if I'm working with updating data), but this plugin is mainly for the "GET" queries that comprise about 90% of the workload (and would contribute $$$$s to my bubble bill every month otherwise!).

    What I would love to see with this plugin though, is the ability to extend a user session when a call is executed… rather than using a ridiculously long session expiry. I'd much rather set, say 48 hours on the authorisation token, which can be extended with any authenticated call for that session. I do this already, but it's clunky - needing separate workflows to handle the call under certain conditions and storing the value.

    If this plugin could have an optional additional endpoint configuration option, say "/auth/extend", and any call via one of the plugin components had an optional checkbox to say: "extend session", this plugin could then use the authToken in the response, and update the cache with the latest token.

    Apart from that… I'd love to see more current documentation for this as I actually had to read the plugin code, then dig into the JS doco for the Xano connector to work out what some of the settings should be before I got it to work at all.

  • Marc Girard
    Options

    Hi @Eli Beachy, thanks for the plugin you offered us.

    I get the error bellow when I set a Xano get element to retrieve a single record. I haven't seen that kind of error is this forum, would you know how this error occurs ?

  • Marc Girard
    Options

    EDIT from the post above :

    I was able to trace the problem. This error (undefined is not iterable) appears because an object does not appear in the query response. It is a single object that is obtained by using an addon (defined as returning a single item) but when the object does not exist, the addon does not return an empty object {}, it simply returns nothing as if the object never existed. However, if the addon returns a list of objects (list of items), then the addon gives [] so I don't get the error.

    Any solution for this?

  • @Marc Girard - the only way to avoid this is to build your own custom variable that your return and initialise the array first. Bit of a workaround, but it does work.

  • Eli Beachy
    Options

    @Marc Girard This is a known issue but is a Bubble limitation. Here's a video that describes the issue:

  • Marc Girard
    Options

    Hi @Know It Now and @Eli Beachy ,

    Sorry for the late reply.

    I now understand why it's happening thanks to you and by searching a bit more in the forum, I turnaround for Xano would be to be able to return a default value when an addon returns empty, even if it's at first a bubble issue.

    And

  • Marc Girard
    Options

    Hey all,

    I have submitted a feature request on that "default value for addons response", if you want to upvote it.

    https://xano.nolt.io/359

  • Louis Machado - CSA
    Louis Machado - CSA Administrator

    ADMIN

    Options

    Thank you, Marc, for taking the time to share your feedback with us and help us build a better product. I'm certain that many users would also benefit from this feature.