Before you get started
Before you begin, follow the steps to get started with a 1Password SDK. The examples on this page assume you have an initializedclient instance. For example:
- Go
- JavaScript
- Python
Get a group
- Go
- JavaScript
- Python
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
New! Use the 1Password MCP Server for Codex to manage Environments without ever exposing secrets to the agent.
client instance. For example:
package main
import (
"context"
"github.com/1password/onepassword-sdk-go"
)
func main() {
// TODO: Initialize client using your preferred authentication method (see Overview > Get started)
client, err := onepassword.NewClient(context.Background(),
)
if err != nil {
panic(err)
}
// Your code here
}
import sdk from "@1password/sdk";
async function main() {
const client = await sdk.createClient({
// TODO: Initialize client using your preferred authentication method (see Overview > Get started)
});
// Your code here
}
main().catch(console.error);
const sdk = require("@1password/sdk");
async function main() {
const client = await sdk.createClient({
// TODO: Initialize client using your preferred authentication method (see Overview > Get started)
});
// Your code here
}
main().catch(console.error);
import asyncio
from onepassword import Client # Also import DesktopAuth for desktop app authentication.
async def main():
# TODO: Initialize client using your preferred authentication method (see Overview > Get started)
client = await Client.authenticate(...)
# Your code here
asyncio.run(main())
Groups().Get() method.Replace groupID with the group’s unique identifier.// Get a group
group, err := client.Groups().Get(context.Background(), groupID, onepassword.GroupGetParams{})
if err != nil {
panic(err)
}
fmt.Printf("Group details: %v\\n", group)
groups.get() method.Replace groupId with the group’s unique identifier.// Get a group
const group = await client.groups.get(groupId, { vaultPermissions: false });
console.log(JSON.stringify(group));
groups.get() method.from onepassword import GroupGetParams
# Get a group
group = await client.groups.get("your-group-id", GroupGetParams(vaultPermissions=False))
print(group)
Was this page helpful?