Files
payloadcms/test/plugin-sentry/config.ts
Elliot DeNolf 7309d474ee feat!: type auto-generation (#6657)
Types are now auto-generated by default.

You can opt-out of this behavior by setting:
```ts
buildConfig({
  // Rest of config
  typescript: {
    autoGenerate: false
  },
})
```
2024-06-10 13:42:44 -04:00

48 lines
1.2 KiB
TypeScript

import { fileURLToPath } from 'node:url'
import path from 'path'
const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
import { sentryPlugin } from '@payloadcms/plugin-sentry'
import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js'
import { devUser } from '../credentials.js'
import { Posts } from './collections/Posts.js'
import { Users } from './collections/Users.js'
import { testErrors } from './components.js'
export default buildConfigWithDefaults({
admin: {
components: {
beforeDashboard: [testErrors],
},
user: Users.slug,
},
collections: [Posts, Users],
onInit: async (payload) => {
await payload.create({
collection: 'users',
data: {
email: devUser.email,
password: devUser.password,
},
})
},
plugins: [
sentryPlugin({
dsn: 'https://61edebe5ee6d4d38a9d6459c7323d777@o4505289711681536.ingest.sentry.io/4505357688242176',
options: {
captureErrors: [400, 403, 404],
init: {
debug: true,
},
requestHandler: {
serverName: false,
},
},
}),
],
typescript: {
outputFile: path.resolve(dirname, 'payload-types.ts'),
},
})