GET
/
v1
/
oauth2
/
userinfo
package main

import(
	"context"
	"os"
	polargo "github.com/polarsource/polar-go"
	"log"
)

func main() {
    ctx := context.Background()
    
    s := polargo.New(
        polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
    )

    res, err := s.Oauth2.Userinfo(ctx)
    if err != nil {
        log.Fatal(err)
    }
    if res.ResponseOauth2Userinfo != nil {
        // handle response
    }
}
{
  "sub": "<string>",
  "name": "<string>",
  "email": "<string>",
  "email_verified": true
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Response

200 - application/json
Successful Response
sub
string
required
name
string | null
email
string | null
email_verified
boolean | null

Was this page helpful?