Automatically Sync with Xano on a Static Collection

Hi, I wanted to know if there is a way to automatically sync a Static collection with Xano backend so that static pages for the new entries keep generating without any manual interference?

2 Likes

I have similar question.

When I update record and post to Xano I want my static collection to be updated too with this changes.

How to do it ? Add action to workflow where I post to backend?
But which action?

1 Like

Hi @switchfuseunit & @Anna.fae,

We need to add the option for the Xano static collections. Meanwhile, you can use instead the REST API plugin for your static collections. You will find the hook in the Fetch data category. Here :point_down:

After making the call to this hook to trigger the synchronization, you can then call the publish hook that you can find here :point_down:

Tell us if that works for you :slight_smile:

3 Likes

Hi @flo, thanks for the info.

To clarify my understanding, this publishes the updates to your WeWeb app’s design and logic—it doesn’t just update the data in the static collection. Is that correct?

In other words, if I want a user of a CMS that works with Xano to add new items to Xano and for that to be synced with the WeWeb static collection, there isn’t currently a way to do that without also automatically publishing changes I might have in progress on my WeWeb project. Am I understanding correctly?

1 Like

Ah yes @caffeinatedwes, if you use the hook to publish your WeWeb project automatically, it will publish all changes, not just the updates to the static collection.

You could use a Dynamic collection page to keep the content in sync without having to republish the entire project but if you want static URLs like @switchfuseunit and @Anna.fae, you don’t have that flexibility.

2 Likes

Got it, thanks for letting me know. That would be a useful feature in the future, but not blocking things. I’ll be careful in the meantime.

1 Like

Has an updated solution been found to this?

Hi @RCS,
the best approach now is to use a dynamic collection and route parameters instead of static collection pages.
(route parameters were not available before)
Static collection cannot be changed “dynamically”, they need a republish.
Dynamic collection are the best approach if you need them to change between publish.
The limitation before was that repeat pages worked only with static collections. That’s still the case, but you can instead use dynamic page with route parameters, coupled with a dynamic collection

Hope this helps

1 Like

Did notice this in the recent update too but I believe a static collection would still much better for SEO. Isn’t there a way to enhance how the static collection work so that we can publish a change for a specific API record which basically refetches that specific record and publishes it?

Thanks!

2 Likes

We have a flow for a client which does this. To make it work, after updating the data through other flows, we hit the “sync all to the collection” webhook.

We then instruct the user to “republish” the changes by hitting a button within the UI that triggers the WeWeb “publish project” hook.

However, as of late November, WeWeb deprecated the ability to see this “publish project” webhook within the UI. Luckily, the webhook still works and the client still has this functionality. They republish the data programmatically several times a week.

The last update I heard from @Quentin was that WeWeb would bring this feature back after deprecating the current functionality:

At the moment we don’t have any deprecated date for the hook, it’s being postponed. We’ll tell you in advance when this is the case.

For context, the current webhooks are being deprecated due to security concerns:

We will indeed depreciated those links in time as soon as possible for security reasons. Some people were using those links in a malicious way that could lead to break our publisher server. That’s why we had to do this change quickly for new users.

It’s possible you can do what you want with the setup I’ve described above—I would ask the WeWeb team to provide you with a link to the specific publish project hook.

2 Likes

Thanks for sharing. Was thinking of doing this but as you’ve mentioned, it seems some parts of this approach might be changed or deprecated so I thought it would be best to avoid going with this approach.

However, we still need an SEO-friendly way to do this. I am hoping Weweb’s team can shed some light as to how best to apply this.

Thanks again!

2 Likes

are there docs on these webhooks to sync the static collections then to publish the data?

this doesnt seem to exist anymore

It’s now here:

But we’ll improve it as some users were hitting the limits hard, and spamming the hooks. We’ll probably implement rate limits in the future :wink:

that doesnt seem to exist on my account

Thanks Quentin.
I assume it is still manually done and there is no way for example to fetch a specific collection item if it is updated on BE?

Not if it’s a static collection, as these aren’t filtered

@Quentin are there plans to bring back the publish hooks for non Enterprise customers in the future?

From what I read, it was disabled because of the amount of resources it took to generate it. Maybe something like using the publish hook (or the public Weweb API) once a day is included could be a compromise.

1 Like