Build Nuxt 4 manager cabinet workflows
This commit is contained in:
23
app/plugins/apollo.ts
Normal file
23
app/plugins/apollo.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { ApolloClient, HttpLink, InMemoryCache } from '@apollo/client/core';
|
||||
import { provideApolloClient } from '@vue/apollo-composable';
|
||||
|
||||
export default defineNuxtPlugin(() => {
|
||||
const config = useRuntimeConfig();
|
||||
|
||||
const client = new ApolloClient({
|
||||
link: new HttpLink({
|
||||
uri: config.public.graphqlEndpoint,
|
||||
fetch,
|
||||
}),
|
||||
cache: new InMemoryCache(),
|
||||
connectToDevTools: import.meta.dev,
|
||||
});
|
||||
|
||||
provideApolloClient(client);
|
||||
|
||||
return {
|
||||
provide: {
|
||||
apollo: client,
|
||||
},
|
||||
};
|
||||
});
|
||||
18
app/plugins/sentry.client.ts
Normal file
18
app/plugins/sentry.client.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import * as Sentry from '@sentry/vue';
|
||||
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
const config = useRuntimeConfig();
|
||||
const dsn = config.public.sentryDsn;
|
||||
|
||||
if (!dsn) {
|
||||
return;
|
||||
}
|
||||
|
||||
Sentry.init({
|
||||
app: nuxtApp.vueApp,
|
||||
dsn,
|
||||
environment: config.public.sentryEnvironment,
|
||||
release: config.public.sentryRelease,
|
||||
tracesSampleRate: 0.1,
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user