Github api and hardcoded auth key vs env variable key

I’m using the github api to retrieve all my latest activity on github

await octokit.rest.activity.listEventsForAuthenticatedUser({username})

When I hardcode my auth key I get an array containing all of my activity since the beginning of the year and returning the data I need.

const octokit = new Octokit({ auth: 'hardcoded-auth-key' });

However when I put that auth key in an .env file and use an environment variable, it’s returning an array of only 2 of the recent events (it seems to be the latest one and the first one of the year).

const octokit = new Octokit({ auth: process.env.GITHUB_KEY });

Any ideas whats going on here?

My goal is to get the last time I made a commit to github so I can put it on my personal website. Is there another way of doing this that doesn’t require an auth key?