title: How to generate the JWT token using Prisma API?
body: <p>I am using <a href="https://www.prisma.io/docs/prisma-server/authentication-and-security-kke4/" rel="nofollow noreferrer">prisma</a> to work with the GraphQL. I know there is a way to secure the graphql server with a secret key. For example on specifying the secret key as:</p>
  
  <pre><code>secret: my-secret-42
  </code></pre>
  
  <p>in <code>prisma.yml</code> , and then running <code>prisma deploy</code> will secure the graphql server and all the subsequent queries will need a JWT token to access it.</p>
  
  <p>I am able to generate the JWT token using the command</p>
  
  <pre><code>prisma token
  </code></pre>
  
  <p>This gives me the token and on passing it in the headers, I am able to access it. But is there an API using which I could generate the token and I do not have to manually run the <code>prisma token</code> command on the CLI.</p>
  
  <p>I want the javascript to directly access the GraphQL via queries. For this, I need some form of authentication to happen. Since there would be multiple users using the application, I want to have different tokens for different users. Thus I am looking for a way where I could generate the token using the API if available with Prisma.</p>