@solid-mediakit/prpc-plugin
v2.1.0
Published
Package for easily creating server rpc functions in solid-start with goodies baked in
Downloads
275
Readme
@solid-mediakit/prpc-plugin
A Vite plugin for pRPC
Installation
pnpm install @solid-mediakit/prpc-plugin
Add to app.config.ts
Wrap your entire config with the withPRPC
method for typesafety:
import { withPRPC } from '@solid-mediakit/prpc-plugin'
const config = withPRPC(
{
ssr: true,
},
{
auth: 'authjs',
authCfg: {
source: '~/server/auth', // where your AuthJS config is located
configName: 'authOpts', // The variable name of your AuthJS Config
protectedMessage: 'You need to sign in first',
},
},
)
declare module '@solid-mediakit/prpc' {
interface Settings {
config: typeof config
}
}
export default config