Skip to content

Programmatically Access Project URL from Token #1441

@barisozmen

Description

@barisozmen

Description

Hello Logfire team,

I recently ran into a need to programmatically retrieve the project URL from my write token. Currently, this isn’t straightforward—I had to dig into the source code to figure it out (pointer: test_configure.py#L1500).

Right now, I’m using the following workaround:

from logfire._internal.config import LogfireConfig        

credentials = LogfireConfig()._initialize_credentials_from_token("...")

print(credentials.project_url)

While this works, it depends on internal APIs, which may not be stable or intended for external use.

Proposed Improvement

It would be useful if the project URL could be accessed directly through the public logfire module after configuration. For example:

import logfire

logfire.configure(token="...")

print(logfire.project_url)

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions