Cannot access private repo with permanent master+releases token

The following code works just fine on my public repos, but it won't work on my private repos with a master+releases permanent access token and I'm unclear as to why.

const client = prismic.createClient(repos[repo], {
  accessToken: `${repos[repo]
    .replace(/-/g, '_')}_PRISMIC_TOKEN`


const posts = await client.getAllByType(types[t]);

This throws Invalid access token when attempting to access the private repo. I have tried creating multiple tokens and none have worked.

Hi @ecommerce-team,

Thanks for reaching out.

I'm not sure I understand why you do this code? and why did you modify the access token?

    .replace(/-/g, '_')}_PRISMIC_TOKEN`