W
Wasp4w ago
p4j4r5

After login, call a function to send message to extension to store session id

I want the user to login on website and when he logs in , website calls authenticate with API using header Bearer < Bearer token> I would like to send this token to background script of my chrome extension so that it is avaliable for chrome extension. How to do this?
2 Replies
kapa.ai
kapa.ai4w ago
Hi @p4j4r5. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the information provided in the knowledge sources, I don't have enough specific details to fully answer your question about sending a token from a Wasp-based website to a Chrome extension's background script. The knowledge sources don't contain information about integrating Wasp with Chrome extensions or sending data between a website and a browser extension. However, I can provide some general information about authentication in Wasp that might be helpful: 1. Wasp uses sessions for authentication, storing session information in localStorage on the client and in the database on the server. This is mentioned in the Auth Overview documentation. 2. After a successful login, Wasp creates a session for the user. You might be able to access this session information, but the exact method isn't specified in the provided knowledge sources. 3. There's an open feature request for Wasp to provide hooks that execute custom server code after login/sign-in, as mentioned in this GitHub issue. This feature, if implemented, could potentially be used to send data to a Chrome extension, but it's not currently available. To send data from a Wasp-based website to a Chrome extension, you would likely need to implement a custom solution. This might involve creating a custom API endpoint in Wasp that your extension can call, or using browser messaging APIs to communicate between your website and the extension. However, the specific implementation details for this are not covered in the provided knowledge sources. For the most up-to-date and specific guidance on integrating Wasp with Chrome extensions, I recommend checking the official Wasp documentation or reaching out to the Wasp community for more targeted assistance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @p4j4r5, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?

Did you find this page helpful?