Instagram feed snippet: what is a safe place to keep token

Hi there,

I am pulling my 4 most recent images from my Instagram account with a simple php script. Where should I place my API token and userID? If I put it in my ‘instagram’ snippet it is probably not safe.

Thanks.

In config or a file that you read in config (if you commit config to a public repo)

Oke thank you!
I tried that but could’n find how to pull my api token from my config file into the snippet. Can you tell me that?

Like any other config setting, using the option() helper:

e.g in config.php

<?php
return [
  'debug'       => false,
  'mysecretkey' => 'abc'
];

Wherever you want to retrieve the option:

<?php $secretKey = option('mysecretkey') ?>
1 Like

Will try it and let you know!

It worked pretty good! Awesome. :pray:
Thanks!

1 Like