Adding Custom Information to Metadata in Tyk

Hi everyone,

I’m using Tyk and would like to add custom application information, such as the application name, to the metadata. I need this information to verify some business logic in the middleware.
Is it possible to add or access the application name directly in the middleware without making an extra call to the Tyk API?
Does Tyk support this kind of setup?

Thanks in advance,
Quan

Hi @lhquan244 ,

Welcome to Tyk Community. Are you by chance referring to embedding the custom application info in the session metadata? If so, you might need to check this documentation where session metadata can be used in custom plugins: Security Policy and Access Keys
There’s also a sample on how metadata can be used in the plugin: GitHub - TykTechnologies/tyk-grpc-go-basicauth-jwt: Custom BasicAuth with JWT to Upstream

Hi Page,

Thanks for the reply!

I’m using Tyk with the Enterprise Developer Portal, and I’m trying to include some custom application info—specifically the application name—in the session metadata when a key is generated.

The reason I want to do this is so I can access that info in a middleware plugin to handle some business logic, without needing to make an extra call to the Tyk API.

I’ve looked through the docs and examples like tyk-grpc-go-basicauth-jwt, but I couldn’t find a clear way to automatically include app-level metadata like the application name when a key is created through the Developer Portal.

So I’m wondering:

  1. Is there a way to have the application name automatically added to the session metadata when the key is created?
  2. If not directly supported, is there a recommended workaround—maybe using custom templates or hooks?

Appreciate any guidance you can share!

Thanks a lot,
Quân