Remove a session key

Remove a permission

import {
    erc7579Actions,
    smartSessionActions,
} from "@cometh/connect-sdk-4337";

// At session key creation, you'll get the associated permissionId that you need to store
export const permissionId = "0x...";

const safe7559AccountClient = smartAccountClient.extend(smartSessionActions())
            .extend(erc7579Actions());

const removeSessionsResponse = await safe7559AccountClient.removeSession({
    permissionId: permissionId,
});

await safe7559AccountClient.waitForUserOperationReceipt({
    hash: removeSessionsResponse.userOpHash,
});

Last updated