We have an app which was previously using locally hosted Payload and was relying on
getPayload
function to connect to the service.
Now, we are migrating to Payload Cloud and realising that we'll have to rewrite all the services to use Rest APIs.
Is there a way that we can reuse our structure and simply connect to the cloud using something similar to
getPayload
?
Interesting, I might be missing something in how you're using Payload, but how does hosting this in Payload Cloud change your usage?
Now, we are migrating to Payload Cloud and realising that we'll have to rewrite all the services to use Rest APIs.
Can you expand upon why you think that's the case?
I had this same query, actually.
I think the assumption is that the local API won’t work on payload cloud because payload is doing the work of connecting up to atlas mongo etc, while a front-end consumer of the payload cloud instance isn’t locally hosted alongside it, so presumably you need to use REST or GraphQL APIs to consume the data, for example in a nextjs app on vercel?
Hmm, we already expose the mongo connection string in the Cloud UI. I bet we could expose the payload secret as well. This would allow you to do
payload.init
from anywhere.
Would that solve for this use-case?
Hey,
@Erielia summed it up pretty nicely.
@denolfe
I believe we'll be set if I am getting
1. Mongo connection string
2. Payload Secret
3. Config? Can I get it?
Wherever you're performing your
payload.init
would need access to the config, but that's coming from your code repository in the first-place. It's not
storedin Payload Cloud for retrieval or anything like that.
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.