How to access Repo secrets
How can I access the Repo secrets in the code? I can’t seem to find any related documentation. Appreciate any help!
2022-06-09T19:34:47Z
NVM, I solved it. It seems that the secrets are available as environment variables:Spaces Overview.
2023-02-17T02:08:57Z
@IssakaAICan you show how you referenced the secret here?Thanks!
2023-02-19T21:20:31Z
Hi@iamrobotbear. In the Space settings, you can set Repository secrets. In your code, you can access these secrets just like how you would access environment variables.For example, if there is a Repository secret calledAPI_TOKEN, you can access it usingos.environ['API_TOKEN'].