Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

**WIP** method getSessionDetails() added #194

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

shalomgk
Copy link

@shalomgk shalomgk commented Apr 3, 2025

WorkItem: https://app.devrev.ai/devrev/works/ISS-161669

Add PLuG web SDK methods

  • getSessionDetails()
  • isSearchAgentOpen

@shalomgk shalomgk requested a review from a team as a code owner April 3, 2025 09:07
Copy link
Contributor

github-actions bot commented Apr 3, 2025

🌟 EkLine Reviewer

Hello! I’m here to help improve your docs. I’ve reviewed your pull request, and left in-line suggestions for quick fixes. For details, visit the Analytics Page.

For questions or feedback, please email [email protected].

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [EkLine] reported by reviewdog 🐶

Where possible, do not structure sentences in future tense. Use present tense instead. (EK00005)

|`widget_alignment` |The PLuG widget can be positioned on either the left or right side of the launcher. You can also adjust the widget alignment through the PLuG settings at app.devrev.ai. If alignment settings are configured in both places, the value from app.devrev.ai will override the launcher setting. |left or right |

Copy link
Contributor

github-actions bot commented Apr 3, 2025

Copy link
Contributor

github-actions bot commented Apr 3, 2025

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [EkLine] reported by reviewdog 🐶

Suggestions:

    Where possible, do not structure sentences in future tense. Use present tense instead. (EK00005)

Once the `shutdown()` method is called, all other widget functionalities, such as session recording and Nudges, will also be stopped. You will need to reinitialize the widget to reactivate these features.

Copy link
Contributor

github-actions bot commented Apr 3, 2025

@shalomgk shalomgk changed the title method getSessionDetails() added **WIP** method getSessionDetails() added Apr 3, 2025
Copy link
Contributor

github-actions bot commented Apr 3, 2025

Copy link
Contributor

@bc-devrev bc-devrev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with a couple suggestions.

@@ -165,9 +175,17 @@ window.plugSDK.addSessionProperties({
});
```

## Get session details

You can use the `getSessionDetails` method to fetch the session id and tab id of currently ongoing session. These details can then be passed across different domains to maintain the journey as a single, continuous session.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can use the `getSessionDetails` method to fetch the session id and tab id of currently ongoing session. These details can then be passed across different domains to maintain the journey as a single, continuous session.
You can use the `getSessionDetails` method to fetch the session ID and tab ID of currently ongoing session. These details can then be passed across different domains to maintain the journey as a single, continuous session.

window.plugSDK.isSearchAgentOpen
```

This returns true if the search agent is open and false if it is closed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This returns true if the search agent is open and false if it is closed.
This returns `true` if the search agent is open and `false` if it is closed.

set identifier without session token
You can also pass the identifiers in the `plugSDK.init` option without generating the session token.

<Callout intent="note">
The frontend method, by its nature, is not secure as the data is transmitted through the client side. We recommend using the session token method to securely identify users.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [EkLine] reported by reviewdog 🐶

Avoid using 'we' as it can come off as patronizing. For example, write 'The configuration is complete' rather than 'We are now done with the configuration.' (EK81039)

Suggested change
The frontend method, by its nature, is not secure as the data is transmitted through the client side. We recommend using the session token method to securely identify users.
The frontend method, by its nature, is not secure as the data is transmitted through the client side. The session token method is recommended to securely identify users.

Copy link
Contributor

github-actions bot commented Apr 4, 2025

add bind hotkey example

## Bind hotkey to toggleSearchAgent

You can bind the `toggleSearchAgent` method to a hotkey, such as `Cmd + K` (or `Ctrl + K` for Windows), to toggle the search agent quickly. Here's an example implementation:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [EkLine] reported by reviewdog 🐶

Remove 'quickly' if it's not important to the meaning of the statement. (EK00006)

Suggested change
You can bind the `toggleSearchAgent` method to a hotkey, such as `Cmd + K` (or `Ctrl + K` for Windows), to toggle the search agent quickly. Here's an example implementation:
You can bind the `toggleSearchAgent` method to a hotkey, such as `Cmd + K` (or `Ctrl + K` for Windows), to toggle the search agent. Here's an example implementation:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [EkLine] reported by reviewdog 🐶

Suggestions:

    Where possible, do not structure sentences in future tense. Use present tense instead. (EK00005)

|`custom_launcher_selector` |A CSS selector string is used to match the element to which the widget will be attached. You can also set this selector from the PLuG settings on app.devrev.ai. If both sources are set, this value will be considered the definitive source. |Boolean (True or False) |

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [EkLine] reported by reviewdog 🐶

Where possible, do not structure sentences in future tense. Use present tense instead. (EK00005)

|`spacing` |Padding from the launcher: This padding can also be set in the PLuG settings on app.devrev.ai. If a value is specified in both places, this value will be considered the definitive source. Bottom: Padding from the bottom of the launcher. Side: Spacing from the sides of the launcher |object `{bottom: string; side: string;}` |

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [EkLine] reported by reviewdog 🐶

Where possible, do not structure sentences in future tense. Use present tense instead. (EK00005)

Ensure you copy your access token, as you will not be able to view it again.

Copy link
Contributor

github-actions bot commented Apr 4, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants