(for sharing payload config across apps leveraging payload localAPI)

Base context

This article is my personal contribution to this thread on the community support channel of the official payload discord server: https://discord.com/channels/967097582721572934/1350714672411574323/1350714672411574323 about:

"How to use localApi from external project (import/export payload config)"

We discussed the following options:

After thoughts, we could have also explored a tRPC solution perhaps ? not covered here, but interested if anyone did this.

Now that initial context is setup, here I explored what seamed the cleanest solution to my problem: the turbo-payload template project. I had to refactor my multi-repo project in a monorepo, moving the payload config in a shared package.

I came from:

I aimed for a monorepo with:

It was my first experience with monorepo, pnpm workspaces, turbo, and I have some difficulties migrating my project. I thought it might help someone else to keep track of all the things I had difficulties to understand, and the different issue I faced.