Using adapters with UI components #3945
alkwa-msft
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Using adapters with UI components
Customers want to use the UI Library but they may find they want to work directly with components over the composites. We suggest using the adapter instead of working directly with the SDK as we have provided additional functionality. (e.g being able to start a call with your camera on). By the end of this guide you should be able to create your own prototype code
using UI components and the adapter from the UI Library.
In this Show+Tell we are going to share:
Setting up the UI Library "adapter" in a useEffect block. *Demonstrative not meant for production loads
we are using useState hooks for callClient, callAgent, adapter, and call.
e.g const [callClient, setCallClient] = useState<StatefulCallClient | undefined>(undefined);
Setup UI Library providers for UI components to automatically connect to your ACS Calling SDK state
We need to 4 providers (3 for calling and 1 for fluent)
Use the adapter to join a call
We leverage the joinCall options from the UI Library to start with your camera on if you have a camera connected to your computer and it is available and ready to be used. You can learn more about the Calling adapter here
We expose all major functionality through the adapter. In this show+tell we are using it to join the group call. Other interesting ideas you can use the adapter with:
The whole app.tsx together to try out
We have also added a whole code block to paste into an app.tsx of a create-react-app. You just need to enter in your own userId, token, and groupId to try out this snippet
Beta Was this translation helpful? Give feedback.
All reactions