I'm really happy that I found a way to use server actions inside the package 📦. This was really frustrating as the whole architecture and working of the package started collapsing. But not anymore 👊🏻. Now we are ready to implement server actions inside our client components. This was possible due to Clerk.js's approach to handling similar problems regarding the "use client" flag.
I was so tired of trying different approaches to build the package without using server actions. But soon, I realized that it's impossible to implement all the authentication logic like cookies and all. Then, after trying multiple failed approaches to achieve the output, I decided to take a look at Clerk.js's repo for Next.js. When I saw how they are doing SSR and CSR, it gave me some hope that it'll work. And guess what happened!!??
It works babyyy 🤫🧏🏻♂️.