You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How can I access another plugin鈥檚 registered options inside Fastify?聽#1108
I have a situation where multiple plugins are registered in my Fastify app. Each plugin can receive its own options object when registered, for example:
The plugin should be registered with Symbol.for('skip-override') to customize the upper context instead of creating a new one. Recommend you to use fastify-plugin to wrap your plugins, includes all these settings by default
fastify.register(fp(require('./pluginA'),{name: "pluginA"}),{foo: 'bar'})fastify.register(fp(asyncfunction(fastify,opts){// Can I access the options of pluginA here?// For example: { foo: 'bar' }}))
Is there a way to access another plugin鈥檚 options like this?
Activity
metcoder95 commentedon Aug 26, 2025
The plugin should be registered with
Symbol.for('skip-override')to customize the upper context instead of creating a new one. Recommend you to usefastify-pluginto wrap your plugins, includes all these settings by defaultinyourtime commentedon Aug 26, 2025
Is there a way to access another plugin鈥檚 options like this?
metcoder95 commentedon Aug 27, 2025
Unless the plugin exposes somehow that information, is not currently possible