This method allows you to seamlessly redirect the user to another section of the application without completely reloading the page.
Platforms
- B2B-Web
Method params
Parameter name | Parameter type | Required | Parameter description |
---|---|---|---|
url | string | yes | Url to redirect to |
target | _self | _blank | yes | Redirect target |
In order to redirect the user in the current window, the origin link must match the origin of the main window.
In other words, only links to other sections of the main application are allowed in the current window.
All third-party resources must be opened in a new tab.
Return value
If successful, the method will return a JSON object containing a single
success
field:json{ "success": true }
Usage example
typescript// pages/success.tsx import React, { useCallback } from 'react' import bridge from '@open-condo/bridge' import { Typography, Space, Button } from '@open-condo/ui' export default function SuccessPage (): React.ReactNode { const onClick = useCallback(() => { bridge.send('CondoWebAppRedirect', { url: 'https://condo.d.doma.ai/ticket', target: '_self' }) }, []) return ( <Space size={16} direction='vertical'> <Typography.Paragraph type='secondary'> Congratulations, the configuration of the mini-application is complete. Tickets from the bot will now automatically appear in the system. </Typography.Paragraph> <Button type='primary' onClick={onClick}>To tickets</Button> </Space> ) }