将数据写入供应商目录中的文件

I have developed a php class which would be hosted on github and packagist. I have a created a data.json file to read/write credentials data.

$data = array(
    'access_token' => $access_token
);
$data = json_encode($data);

if(is_writable('data.json')) file_put_contents('data.json', $data);

When i install this package in my other app using composer, i get following error...

file_get_contents(data.json) failed to open stream: No Such file or directory.

I really want to save access_token to data.json which will be in vendor directory, so suggest me any good way to achieve this. Thanks