Skip to main content

Documentation Index

Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

AI SDKs

Here are the configuration options for private context attributes in AI SDKs:

.NET AI

In the .NET AI SDK you can mark attributes as private when building the context object by calling Private() after setting the attribute on the context builder.For example:
      var context = Context.Builder("example-context-key")
          .Set("email", "sandy@example.com")
          .Private("email")
          .Build();
When the SDK sends this context back to LaunchDarkly, it removes the email attribute.

Go AI

In the Go AI SDK you can mark attributes as private when building the context object by calling Private() after setting the attribute on the context builder.For example:
      import (
          "github.com/launchdarkly/go-sdk-common/v3/ldcontext"
      )

      context := ldcontext.NewBuilder("example-context-key").
          Kind("organization").
          Name("Global Health Services").
          SetString("email", "info@globalhealthexample.com").
          Private("email").
          Build()
When the SDK sends this context back to LaunchDarkly, it removes the email attribute.

Node.js (server-side) AI

In the Node.js (server-side) AI SDK you can define a set of privateAttributes on the context object.Here’s how:
      const context: LDContext = {
        kind: 'user',
        key: 'example-user-key',
        email: 'sandy@example.com',
        privateAttributes: ['email'],
      };
When the SDK sends this context back to LaunchDarkly, it removes the email attribute.

Python AI

In the Python AI SDK you can mark attributes as private when building the context object by calling the private builder method.Here’s how:
      context = Context.builder("example-context-key") \
          .set("email", "sandy@example.com") \
          .private("email") \
          .build()
When the SDK sends this context back to LaunchDarkly, it removes the email attribute.

Ruby AI

In the Ruby AI SDK you can mark attributes as private when creating the context.Here’s how:
      context = LaunchDarkly::LDContext.create({
          key: "example-user-key",
          kind: "user",
          firstName: "Sandy",
          lastName: "Smith",
          email: "sandy@example.com",
          groups: ["Acme", "Global Health Services"],
          _meta: {
            privateAttributes: ['email']
          }
      })
When the SDK sends this context back to LaunchDarkly, it removes the email attribute.