-
Hello, I am using I am trying to do a cacheing (is that a word?) plugin: import { TwitterApiCachePluginCore } from '@twitter-api-v2/plugin-cache-core';
class TwitterCachePlugin extends TwitterApiCachePluginCore {
constructor(){
super();
}
async hasKey(key){
console.log("Has key??")
}
async getKey(key){
console.log("Get key??")
}
async setKey(key, response){
console.log("Set key??")
}
} Here is how I dynamically instantiate the client: async function twitterSessionClient({oauth_token, oauth_secret, oauth_verifier}){
const client = new TwitterApi({
appKey: "XXXX",
appSecret: "XXXX",
accessToken: oauth_token,
accessSecret: oauth_secret
}, { plugins: [TwitterCachePlugin] });
} When using the new client to make a request, the console logs nothing. const twitter = await twitterSessionClient(data);
const me = await twitter.client.v2.currentUser() // Logs nothing even if executed multiple times I am certain Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Answered by
edvilme
Jul 19, 2022
Replies: 1 comment
-
Nevermind, forgot to initialize the plugin 🤦🏻 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
edvilme
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nevermind, forgot to initialize the plugin 🤦🏻