mirror of
https://github.com/LukeHagar/plex-sdk-docs.git
synced 2025-12-06 12:37:46 +00:00
36 lines
649 B
Plaintext
36 lines
649 B
Plaintext
{/* Start Go Security Options */}
|
|
### Per-Client Security Schemes
|
|
|
|
This SDK supports the following security scheme globally:
|
|
|
|
|
|
|
|
You can configure it using the `WithSecurity` option when initializing the SDK client instance. For example:
|
|
```go
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"github.com/LukeHagar/plexgo"
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
s := plexgo.New(
|
|
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
|
|
plexgo.WithXPlexClientIdentifier("Postman"),
|
|
)
|
|
|
|
ctx := context.Background()
|
|
res, err := s.Server.GetServerCapabilities(ctx)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
if res.Object != nil {
|
|
// handle response
|
|
}
|
|
}
|
|
|
|
```
|
|
{/* End Go Security Options */}
|