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

Integration managers should use the Widget API #792

Open
justinbot opened this issue Oct 26, 2022 · 0 comments
Open

Integration managers should use the Widget API #792

justinbot opened this issue Oct 26, 2022 · 0 comments

Comments

@justinbot
Copy link

Your use case

Integration managers currently use the "Scalar Messaging API", a rather old and not particularly well-documented API which enables the integration manager iframe to communicate with the client via postmessage to request specific actions like inviting a user or setting a widget.

In many ways, integration managers are very much like widgets -- external pages in an iframe which communicate with the client via postmessage API. It follows then, that it would be a benefit in terms of flexibility and ease of client implementation for integration managers to use the Widget API instead.

Indeed there is already significant overlap in functionality of the two APIs. To the extent that, as far as I can tell the Widget API is already a superset:

Scalar API action Purpose Widget API replacement
close_scalar Closes the integration manager modal close_modal
get_widgets Gets the widgets in the room read_events
set_widget Sets a widget in the room send_event
join_rules_state Gets m.room.join_rules for the room read_events
get_room_enc_state Gets m.room.encryption for the room read_events
membership_state Gets m.room.member for a user in the room read_events
set_bot_power Sets m.room.power_levels for a user in the room send_event
invite Invites a user to the room send_event
kick Kicks a user from the room send_event
get_open_id_token Gets an OpenID token for the current user get_openid

What would you like to do?

Enable integration managers to use the Widget API across all clients.

Why would you like to do it?

Improve flexibility and ease of implementation for both clients and integration managers.

How would you like to achieve it?

Listen for Widget API requests from the integration manager iframe.
There may be other considerations for how the user grants permissions to the integration manager, and how to approach deprecation of the Scalar API.

Have you considered any alternatives?

Another option could be for the integration managers to become a full embedded Matrix client rather than having to communicate with the parent client, but this seems much more complex.

Additional context

No response

Are you willing to provide a PR?

No

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

No branches or pull requests

1 participant